-
Notifications
You must be signed in to change notification settings - Fork 139
feat: integrate StatisticsCollector into parquet writes #1666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
DrakeLin
wants to merge
7
commits into
delta-io:main
Choose a base branch
from
DrakeLin:stack/stats-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,468
−99
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jan 23, 2026
This was referenced Jan 23, 2026
a5734b6 to
b8859a7
Compare
b8859a7 to
1795560
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1666 +/- ##
==========================================
- Coverage 84.65% 84.57% -0.08%
==========================================
Files 123 124 +1
Lines 34109 35063 +954
Branches 34109 35063 +954
==========================================
+ Hits 28875 29655 +780
- Misses 3905 4059 +154
- Partials 1329 1349 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6c7e071 to
6b1b619
Compare
- Add stats_columns parameter to write_parquet_file trait - Add stats_schema(), stats_columns(), get_clustering_columns() to Transaction - Add stats_columns to WriteContext - Update get_write_context() to take engine parameter - Add clustering column support to expected_stats_schema()
- Add StatisticsCollector struct with new(), update(), finalize()
- Track numRecords across multiple RecordBatches
- Output StructArray with {numRecords, tightBounds}
- Basic unit tests for single/multiple batches
This is the foundation for full stats collection, adding column-level
stats (nullCount, minValues, maxValues) in subsequent PRs.
- Add null count tracking for all columns - Support nested struct null counts - Merge null counts across multiple batches - Only collect for columns in stats_columns - Tests for null counting across batches
- Add min/max tracking for all supported types - Primitive types (int8-64, uint8-64, float32/64) - Date, timestamp with all time units - Decimal128 - String types with truncation to 32 chars - Merge min/max across multiple batches - Tests for min/max across single and multiple batches
- Add NullBuffer mask parameter to update() - Only count masked-in rows for numRecords - Only count nulls in masked-in rows for nullCount - Filter column by mask before computing min/max - Tests for mask behavior with min/max and null counting This enables deletion vector support where masked-out rows should not contribute to file statistics.
- Import StatisticsCollector in parquet.rs - Add stats field to DataFileMetadata with with_stats() method - Update as_record_batch to use full stats if available - Update write_parquet_file to collect and attach stats - Update mod.rs write_parquet to pass stats_columns - Update write tests to expect full stats output - Fix write-table example API call
6b1b619 to
9849c2c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR
Use this link to review incremental changes.
What changes are proposed in this pull request?
How was this change tested?