- Rust 99.2%
- Shell 0.5%
- Python 0.2%
- JavaScript 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
## Which issue does this PR close? - Part of https://github.com/apache/datafusion/issues/26682 - Follow on to #26897 ## Rationale for this change We have several issues / PRs open that contemplate changing the I/O pattern such as - https://github.com/apache/datafusion/issues/24393 - https://github.com/apache/datafusion/issues/20324 - https://github.com/apache/datafusion/pull/26387 - https://github.com/apache/datafusion/pull/26418 - https://github.com/apache/datafusion/pull/23492 - https://github.com/apache/datafusion/pull/24086 - https://github.com/apache/datafusion/pull/25811 I want to have a test that clearly shows how those proposals effect the scan ## What changes are included in this PR? Add some new tests that show the Parquet I/O patterns. For example I think this is quite clear now the difference in I/O between filter pushdown and not ```rust /// Without filter pushdown, the scan fetches every column of every row group #[tokio::test] async fn test_filter_pushdown_io_disabled() { let test = filter_pushdown_test(false).await; assert_snapshot!(test.query("SELECT * FROM t WHERE val = 7").await, @r" --- Query: SELECT * FROM t WHERE val = 7 (1 rows) --- Request 1 Read Parquet footer (offsets 0..1402) Request 2 Read dictionary page and data page 0 for column 'id' (rg 0) (offsets 4..51) Read dictionary page and data page 0 for column 'val' (rg 0) (offsets 51..98) Request 3 Read dictionary page and data page 0 for column 'id' (rg 1) (offsets 98..145) Read dictionary page and data page 0 for column 'val' (rg 1) (offsets 145..192) Request 4 Read dictionary page and data page 0 for column 'id' (rg 2) (offsets 192..239) Read dictionary page and data page 0 for column 'val' (rg 2) (offsets 239..286) Produce batch (1 rows) "); } /// **With** filter pushdown, the scan first fetches and evaluates the filter /// column (`val`) for each row group, and then fetches the remaining columns /// (`id`) only for the row groups with matching rows (row group 1). #[tokio::test] async fn test_filter_pushdown_io_enabled() { let test = filter_pushdown_test(true).await; assert_snapshot!(test.query("SELECT * FROM t WHERE val = 7").await, @r" --- Query: SELECT * FROM t WHERE val = 7 (1 rows) --- Request 1 Read Parquet footer (offsets 0..1402) Request 2 Read dictionary page and data page 0 for column 'val' (rg 0) (offsets 51..98) Request 3 Read dictionary page and data page 0 for column 'val' (rg 1) (offsets 145..192) Request 4 Read dictionary page for column 'id' (rg 1) (offsets 98..124) Read data page 0 for column 'id' (rg 1) (offsets 124..145) Produce batch (1 rows) Request 5 Read dictionary page and data page 0 for column 'val' (rg 2) (offsets 239..286) "); } ``` ## What is the testing strategy for this PR? CI ## Are there any user-facing changes? No --------- Co-authored-by: mohitgurav20 <mohitgurav20@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
| .ai/skills | ||
| .cargo | ||
| .devcontainer | ||
| .github | ||
| benchmarks | ||
| ci/scripts | ||
| datafusion | ||
| datafusion-cli | ||
| datafusion-examples | ||
| datafusion-testing@64e2529880 | ||
| dev | ||
| docs | ||
| parquet-testing@107b36603e | ||
| python | ||
| test-utils | ||
| testing@7df2b70baf | ||
| xtask | ||
| .asf.yaml | ||
| .dockerignore | ||
| .editorconfig | ||
| .envrc | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| clippy.toml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| doap.rdf | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE.txt | ||
| licenserc.toml | ||
| lychee.toml | ||
| NOTICE.txt | ||
| pre-commit.sh | ||
| pyproject.toml | ||
| README.md | ||
| rust-toolchain.toml | ||
| rustfmt.toml | ||
| SECURITY.md | ||
| taplo.toml | ||
| typos.toml | ||
| uv.lock | ||
Apache DataFusion
DataFusion is an extensible query engine written in Rust that uses Apache Arrow as its in-memory format.
This crate provides libraries and binaries for developers building fast and feature-rich database and analytic systems, customized for particular workloads. See use cases for examples. The following related subprojects target end users:
- DataFusion Python offers a Python interface for SQL and DataFrame queries.
- DataFusion Java offers a Java interface for SQL and DataFrame queries.
- DataFusion Comet is an accelerator for Apache Spark based on DataFusion.
- DataFusion Ballista is a distributed query execution engine that scales DataFusion across a cluster of nodes.
"Out of the box," DataFusion offers SQL and DataFrame APIs, excellent performance, built-in support for CSV, Parquet, JSON, and Avro, extensive customization, and a great community.
DataFusion features a full query planner, a columnar, streaming, multi-threaded, vectorized execution engine, and partitioned data sources. You can customize DataFusion at almost all points including additional data sources, query languages, functions, custom operators and more. See the Architecture section for more details.
Here are links to important resources:
- Project Site
- Installation
- Rust Getting Started
- Rust DataFrame API
- Rust API docs
- Rust Examples
- Python DataFrame API
- Architecture
What can you do with this crate?
DataFusion is great for building projects such as domain-specific query engines, new database platforms and data pipelines, query languages and more. It lets you start quickly from a fully working engine, and then customize those features specific to your needs. See the list of known users.
Contributing to DataFusion
Please see the contributor guide and communication pages for more information.
We discuss our roadmap via GitHub issues and invite you to join the conversation. The current discussion is the DataFusion 2026 Q3-Q4 Roadmap Discussion.
Crate features
This crate has several features which can be specified in your Cargo.toml.
Default features:
nested_expressions: functions for working with nested types such asarray_to_stringcompression: reading files compressed withxz2,bzip2,flate2, andzstdcrypto_expressions: cryptographic functions such asmd5andsha256datetime_expressions: date and time functions such asto_timestampencoding_expressions:encodeanddecodefunctionsparquet: support for reading the Apache Parquet formatsql: support for SQL parsing and planningregex_expressions: regular expression functions, such asregexp_matchunicode_expressions: include Unicode-aware functions such ascharacter_lengthunparser: enables support to reverse LogicalPlans back into SQLrecursive_protection: uses recursive for stack overflow protection.
Optional features:
avro: support for reading the Apache Avro formatbacktrace: include backtrace information in error messagesparquet_encryption: support for using Parquet Modular Encryptionserde: enable arrow-schema'sserdefeature
DataFusion API Evolution and Deprecation Guidelines
Public methods in Apache DataFusion evolve over time: while we try to maintain a stable API, we also improve the API over time. As a result, we typically deprecate methods before removing them, according to the deprecation guidelines.
Dependencies and Cargo.lock
Following the guidance on committing Cargo.lock files, this project commits
its Cargo.lock file.
CI uses the committed Cargo.lock file, and dependencies are updated regularly
using Dependabot PRs.