GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - apache/datafusion-iceberg: Apache DataFusion Iceberg Integration

BranchesTags
Open more actions menu

Latest commit

 

History

186 Commits
186 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
crates
crates
 
 
dev/release
dev/release
 
 
.asf.yaml
.asf.yaml
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
CLAUDE.md
CLAUDE.md
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
rust-toolchain.toml
rust-toolchain.toml
 
 
rustfmt.toml
rustfmt.toml
 
 

Repository files navigation

Apache Iceberg Table Provider for Apache DataFusion

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.

Workspace

  • 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.

Query an existing table

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.

Development

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.

About

Apache DataFusion Iceberg Integration

datafusion.apache.org/

Topics

arrowdatafusionicebergquery-enginerustsql

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Security policy

Security policy
Activity
Custom properties

Stars

35 stars

Watchers

5 watching

Forks

37 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.