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, MemoryCatalog, Result, TableIdent};

#[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
cache
Cache management for Iceberg.
expr
This module contains expressions.
inspect
Metadata table APIs.
io
File io implementation.
memory
Memory catalog implementation.
puffin
Iceberg Puffin implementation.
scan
Table scan api.
spec
Spec for Iceberg.
table
Table API for Apache Iceberg
test_utils
Test utilities. This module is pub just for internal testing. It is subject to change and is not intended to be used by external users.
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.
MemoryCatalog
Memory catalog implementation.
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.
ViewUpdate
ViewUpdate represents an update to a view in the catalog.

Traits§

Catalog
The catalog API for Iceberg Rust.
CatalogBuilder
Common interface for all catalog builders.

Type Aliases§

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