iceberg_unofficial/lib.rs
1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements. See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership. The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18//! Apache Iceberg Official Native Rust Implementation
19//!
20//! # Examples
21//!
22//! ## Scan A Table
23//!
24//! ```rust, no_run
25//! use futures::TryStreamExt;
26//! use iceberg_unofficial::io::{FileIO, FileIOBuilder};
27//! use iceberg_unofficial::{Catalog, MemoryCatalog, Result, TableIdent};
28//!
29//! #[tokio::main]
30//! async fn main() -> Result<()> {
31//! // Build your file IO.
32//! let file_io = FileIOBuilder::new("memory").build()?;
33//! // Connect to a catalog.
34//! let catalog = MemoryCatalog::new(file_io, None);
35//! // Load table from catalog.
36//! let table = catalog
37//! .load_table(&TableIdent::from_strs(["hello", "world"])?)
38//! .await?;
39//! // Build table scan.
40//! let stream = table
41//! .scan()
42//! .select(["name", "id"])
43//! .build()?
44//! .to_arrow()
45//! .await?;
46//!
47//! // Consume this stream like arrow record batch stream.
48//! let _data: Vec<_> = stream.try_collect().await?;
49//! Ok(())
50//! }
51//! ```
52
53#![deny(missing_docs)]
54
55#[macro_use]
56extern crate derive_builder;
57extern crate core;
58
59mod error;
60pub use error::{Error, ErrorKind, Result};
61
62mod catalog;
63
64pub use catalog::*;
65
66pub mod table;
67
68mod avro;
69pub mod cache;
70pub mod io;
71pub mod spec;
72
73pub mod inspect;
74pub mod scan;
75
76pub mod expr;
77pub mod transaction;
78pub mod transform;
79
80mod runtime;
81
82pub mod arrow;
83pub(crate) mod delete_file_index;
84pub mod test_utils;
85mod utils;
86pub mod writer;
87
88mod delete_vector;
89pub mod puffin;