feat: expose bloom filter, page index and sorting metadata in parquet… #25638
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 82.79%. Comparing base (
334f293) to head (91e6e55).<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## main #25638 +/- ##
==========================================
- Coverage 82.79% 82.79% -0.01%
==========================================
Files 1149 1149
Lines 451645 451645
Branches 451645 451645
==========================================
- Hits 373940 373929 -11
- Misses 54929 54939 +10
- Partials 22776 22777 +1
</details>
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
The updated snapshots exercise several of the new footer fields (bloom_filter_offset=192, column/offset index offset+length, row_group_ordinal, row_group_file_offset), but bloom_filter_length and sorting_columns stay NULL/empty in both fixtures. That is expected for data_index_bloom_encoding_stats.parquet — parquet-testing documents it as having Bloom/page-index metadata without bloom_filter_length.
Because both Some paths stay unobserved, a regression that always pushed None for bloom_filter_length (lines 449–450) or sorting_columns (lines 457–458) would still pass.
parquet-testing already has fixtures for the missing cases:
data/data_index_bloom_encoding_with_length.parquet — same file with bloom_filter_length populateddata/sort_columns.parquet — two row groups with writer-declared sorting columnsWould it be useful to add a focused SELECT/snapshot against those files so extraction of the length (i32 → i64) and format!("{cols:?}") formatting are actually locked in?
>> Would it be useful to add a focused SELECT/snapshot against those files so extraction of the length (i32 → i64) and format!("{cols:?}") formatting are actually locked in?
Okay, of course. I'll add the focused snapshot
Thanks for adding the positive-path coverage for bloom_filter_length and sorting_columns. That addresses my earlier comment. I reviewed the updated diff and test snapshots, and the CLI test job passed on the current PR head. Looks good to me.
Since these metrics are based on the row group, it might be better to move them near to the other row group metrics (i.e., after row_group_bytes).
Is there a difference between the ordinal and the existing row_group_id?
I think the current sorting_columns is difficult to read. To me at least I would prefer the column names instead. E.g.:[SortingColumn { column_idx: 0, descending: true, nulls_first: true }, SortingColumn { column_idx: 1, descending: false, nulls_first: false }]
vscol1 DESC NULLS FIRST, col2 ASC
Thanks @diegoQuinas, I have some requests below.
cc: @kumarUjjawal @alamb since you've reviewed the other PR.
Marked as draft after 14 days without activity: merge conflicts.
Please address these items and mark Ready for review when ready.
rgbuilds
diegoQuinas
…_metadata
Add footer fields already present on ColumnChunkMetaData and RowGroupMetaData to the datafusion-cli parquet_metadata table function.
Which issue does this PR close?
This PR closes one of the three items of the issue #25499
What changes are included in this PR?
It changes datafusion-cli main and functions file, also it updates the docs for the new columns
What is the testing strategy for this PR?
This feature is covered by the unit tests and snapshot tests of datafusion-cli
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
Briefly describe how this PR is tested, and point to the specific tests you added. For example: 'This new feature is covered by the
sqllogictestcases added infoo.slt'.If this PR does not add tests, explain why. For example, if the change is already covered by existing tests, please mention it.
You should also check the
codecovbot reply on this PR to confirm the changed code is exercised.-->
Are there any user-facing changes?
Yes, there are user-facing changes that require documentation (also included in this PR)
No, no breaking changes to public APIs, (beware that the datafusion-cli will exponse more fields in the output)
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
If there are any breaking changes to public APIs, please add the
api changelabel.-->