chore(deps): bump swatinem/rust-cache Bumps the github-actions group with 1 update in the /.github/actions/setup-rust directory: [swatinem/rust-cache](https://github.com/swatinem/rust-cache). Updates `swatinem/rust-cache` from 2.9.2 to 2.9.3 - [Release notes](https://github.com/swatinem/rust-cache/releases) - [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md) - [Commits](https://github.com/swatinem/rust-cache/compare/6323deb102c322ba6fcbdcafc7e3dddab59af2b6...d1527c8f67ef9af357290475d4af4b0fab8f12e0) --- updated-dependencies: - dependency-name: swatinem/rust-cache dependency-version: 2.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
This repository connects Apache Iceberg tables to Apache DataFusion. The iceberg-datafusion crate provides table providers for querying Iceberg data and for inserting rows through an Iceberg catalog.
crates/datafusion: the DataFusion integration library.crates/sqllogictest: SQL logic tests for the integration.crates/playground: a command-line SQL playground backed by DataFusion and Iceberg catalogs.Register IcebergTableProviderFactory in a DataFusion session, then point an external table at an existing Iceberg metadata file:
use std::sync::Arc; use datafusion::execution::session_state::SessionStateBuilder; use datafusion::prelude::SessionContext; use iceberg_datafusion::IcebergTableProviderFactory; async fn query_table() -> datafusion::error::Result<()> { let mut state = SessionStateBuilder::new().with_default_features().build(); state.table_factories_mut().insert( "ICEBERG".to_string(), Arc::new(IcebergTableProviderFactory::new()), ); let ctx = SessionContext::new_with_state(state); ctx.sql( "CREATE EXTERNAL TABLE trips STORED AS ICEBERG \ LOCATION '/absolute/path/to/table/metadata/v1.metadata.json'", ) .await? .collect() .await?; let batches = ctx .sql("SELECT * FROM trips LIMIT 10") .await? .collect() .await?; println!("{batches:?}"); Ok(()) }
Replace the metadata path with one from an existing table whose data files are accessible to the process. External-table registration reads an existing table; it does not create one. For catalog-backed access and inserts, register an IcebergCatalogProvider with a configured Iceberg Catalog. See the integration tests for examples.
The workspace uses a pinned iceberg-rust Git revision. Applications that also depend on Iceberg crates should use the same revision shown in Cargo.toml so Cargo uses one Iceberg crate source.
The repository's rust-toolchain.toml selects the Rust toolchain used by CI. From the repository root, run:
cargo fmt --all -- --check cargo clippy --workspace --locked --all-targets -- -D warnings cargo test --workspace --locked
This project is licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.