{"id":27721553,"url":"https://github.com/datafusion-contrib/datafusion-tpch","last_synced_at":"2026-04-06T06:33:08.970Z","repository":{"id":288825443,"uuid":"969267028","full_name":"datafusion-contrib/datafusion-tpch","owner":"datafusion-contrib","description":"Native Rust TPCH support for Datafusion using tpchgen","archived":false,"fork":false,"pushed_at":"2026-03-24T23:39:11.000Z","size":63,"stargazers_count":3,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-26T05:13:46.486Z","etag":null,"topics":["databases","datafusion","datafusion-testing","tpch","tpchgen-rs"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datafusion-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-19T19:04:26.000Z","updated_at":"2026-03-24T23:39:15.000Z","dependencies_parsed_at":"2025-04-19T21:27:12.055Z","dependency_job_id":"1c8fa726-1e28-43e7-8f78-f378e318b350","html_url":"https://github.com/datafusion-contrib/datafusion-tpch","commit_stats":null,"previous_names":["clflushopt/datafusion-tpch","datafusion-contrib/datafusion-tpch"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/datafusion-contrib/datafusion-tpch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datafusion-contrib%2Fdatafusion-tpch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datafusion-contrib%2Fdatafusion-tpch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datafusion-contrib%2Fdatafusion-tpch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datafusion-contrib%2Fdatafusion-tpch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datafusion-contrib","download_url":"https://codeload.github.com/datafusion-contrib/datafusion-tpch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datafusion-contrib%2Fdatafusion-tpch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31463014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["databases","datafusion","datafusion-testing","tpch","tpchgen-rs"],"created_at":"2025-04-27T10:43:35.923Z","updated_at":"2026-04-06T06:33:08.951Z","avatar_url":"https://github.com/datafusion-contrib.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datafusion-tpch\n\n[![Apache licensed][license-badge]][license-url]\n[![Build Status][actions-badge]][actions-url]\n\n[license-badge]: https://img.shields.io/badge/license-Apache%20v2-blue.svg\n[license-url]: https://github.com/clflushopt/datafusion-tpch/blob/main/LICENSE\n[actions-badge]: https://github.com/clflushopt/datafusion-tpch/actions/workflows/rust.yml/badge.svg\n[actions-url]: https://github.com/clflushopt/datafusion-tpch/actions?query=branch%3Amain\n\nNote: This is not an official Apache Software Foundation release.\n\nThis crate provides functions to generate the TPCH benchmark dataset for Datafusion\nusing the [tpchgen](https://github.com/clflushopt/tpchgen-rs) crates.\n\n## Usage\n\nThe `datafusion-tpch` crate offers two possible ways to register the TPCH table\nfunctions.\n\nYou can register the individual udtfs separately.\n\n```rust\nuse datafusion_tpch::register_tpch_udtfs;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    // create local execution context\n    let ctx = SessionContext::new();\n\n    // Register all the UDTFs.\n    register_tpch_udtfs(\u0026ctx);\n\n    // Generate the nation table with a scale factor of 1.\n    let df = ctx\n        .sql(format!(\"SELECT * FROM tpch_nation(1.0);\").as_str())\n        .await?;\n    df.show().await?;\n    Ok(())\n}\n```\n\nOr you can register a single UDTF which generates all tables at once.\n\n```rust\nuse datafusion_tpch::register_tpch_udtfs;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    // create local execution context\n    let ctx = SessionContext::new();\n\n    // Register all the UDTFs.\n    register_tpch_udtf(\u0026ctx);\n\n    // Generate the nation table with a scale factor of 1.\n    let df = ctx\n        .sql(format!(\"SELECT * FROM tpch(1.0);\").as_str())\n        .await?;\n    df.show().await?;\n    Ok(())\n}\n```\n\n## Examples\n\nTo keep things simple we don't bundle writing to parquet in the table provider\nbut instead defer that to the user who can use the `COPY` command.\n\n\n```rust\nuse datafusion::prelude::{SessionConfig, SessionContext};\nuse datafusion_tpch::{register_tpch_udtf, register_tpch_udtfs};\n\n#[tokio::main]\nasync fn main() -\u003e datafusion::error::Result\u003c()\u003e {\n    let ctx = SessionContext::new_with_config(SessionConfig::new().with_information_schema(true));\n    register_tpch_udtf(\u0026ctx);\n\n    let sql_df = ctx.sql(\u0026format!(\"SELECT * FROM tpch(1.0);\")).await?;\n    sql_df.show().await?;\n\n    let sql_df = ctx.sql(\u0026format!(\"SHOW TABLES;\")).await?;\n    sql_df.show().await?;\n\n    let sql_df = ctx\n        .sql(\u0026format!(\n            \"COPY nation TO './tpch_nation.parquet' STORED AS PARQUET\"\n        ))\n        .await?;\n    sql_df.show().await?;\n\n    register_tpch_udtfs(\u0026ctx)?;\n\n    let sql_df = ctx\n        .sql(\u0026format!(\n            \"COPY (SELECT * FROM tpch_lineitem(1.0)) TO './tpch_lineitem_sf_10.parquet' STORED AS PARQUET\"\n        ))\n        .await?;\n    sql_df.show().await?;\n\n    Ok(())\n}\n```\n\nYou can find other examples in the [examples](examples/) directory.\n\n### Running Examples\n\nTo quickly see the Parquet example in action, you can run the provided example directly from your terminal:\n\n```bash\ncargo run --example parquet\n```\n\n## License\n\nThe project is licensed under the [APACHE 2.0](LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatafusion-contrib%2Fdatafusion-tpch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatafusion-contrib%2Fdatafusion-tpch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatafusion-contrib%2Fdatafusion-tpch/lists"}