Crates.io | iceberg |
lib.rs | iceberg |
version | 0.3.0 |
source | src |
created_at | 2021-08-09 15:01:28.096758 |
updated_at | 2024-08-19 11:17:46.459384 |
description | Apache Iceberg Rust implementation |
homepage | https://rust.iceberg.apache.org/ |
repository | https://github.com/apache/iceberg-rust |
max_upload_size | |
id | 433771 |
size | 1,405,913 |
This crate contains the official Native Rust implementation of Apache Iceberg.
See the API documentation for examples and the full API.
use futures::TryStreamExt;
use iceberg::io::{FileIO, FileIOBuilder};
use iceberg::{Catalog, Result, TableIdent};
use iceberg_catalog_memory::MemoryCatalog;
#[tokio::main]
async fn main() -> Result<()> {
// Build your file IO.
let file_io = FileIOBuilder::new("memory").build()?;
// Connect to a catalog.
let catalog = MemoryCatalog::new(file_io, None);
// Load table from catalog.
let table = catalog
.load_table(&TableIdent::from_strs(["hello", "world"])?)
.await?;
// Build table scan.
let stream = table
.scan()
.select(["name", "id"])
.build()?
.to_arrow()
.await?;
// Consume this stream like arrow record batch stream.
let _data: Vec<_> = stream. try_collect().await?;
Ok(())
}