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§

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

Macros§

Structs§

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

Enums§

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

Traits§

  • The catalog API for Iceberg Rust.

Type Aliases§

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