Crate iceberg

Source
Expand description

Apache Iceberg Official Native Rust Implementation

§Examples

§Scan A Table

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(())
}

Modules§

arrow
Conversion between Iceberg and Arrow schema
expr
This module contains expressions.
io
File io implementation.
scan
Table scan api.
spec
Spec for Iceberg.
table
Table API for Apache Iceberg
transaction
This module contains transaction api.
transform
Transform function used to compute partition values.
writer
Iceberg writer module.

Macros§

ensure_data_valid
Helper macro to check arguments.

Structs§

Error
Error is the error struct returned by all iceberg functions.
Namespace
Namespace represents a namespace in the catalog.
NamespaceIdent
NamespaceIdent represents the identifier of a namespace in the catalog.
TableCommit
TableCommit represents the commit of a table in the catalog.
TableCreation
TableCreation represents the creation of a table in the catalog.
TableIdent
TableIdent represents the identifier of a table in the catalog.
ViewCreation
ViewCreation represents the creation of a view in the catalog.

Enums§

ErrorKind
ErrorKind is all kinds of Error of iceberg.
TableRequirement
TableRequirement represents a requirement for a table in the catalog.
TableUpdate
TableUpdate represents an update to a table in the catalog.

Traits§

Catalog
The catalog API for Iceberg Rust.

Type Aliases§

Result
Result that is a wrapper of Result<T, iceberg::Error>