feat: enforce physical column ordering in Parquet files for two-GET streaming merge#6281
Open
g-talbot wants to merge 3 commits intogtt/docs-claude-mdfrom
Open
feat: enforce physical column ordering in Parquet files for two-GET streaming merge#6281g-talbot wants to merge 3 commits intogtt/docs-claude-mdfrom
g-talbot wants to merge 3 commits intogtt/docs-claude-mdfrom
Conversation
Sort schema columns are written first (in their configured sort order), followed by all remaining data columns in alphabetical order. This physical layout enables a two-GET streaming merge during compaction: the footer GET provides the schema and offsets, then a single streaming GET from the start of the row group delivers sort columns first — allowing the compactor to compute the global merge order before data columns arrive. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The sanity check only asserted presence, not ordering. Now it verifies that host appears before service in the input (scrambled) which is the opposite of the sort-schema order (service before host). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
mattmkim
approved these changes
Apr 9, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
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.
Summary
Implementation
reorder_columns()method inParquetWriterthat reorders aRecordBatch's columns before writingprepare_write()after sorting rows but before buildingWriterPropertiesSortingColumnmetadata indices automatically reflect the reordered schema since they're computed on the reordered batchTest plan
test_column_ordering_sort_columns_first_then_alphabetical— verifies in-memory reordering logictest_column_ordering_preserved_in_parquet_file— reads back a written Parquet file and verifies physical column order from the schema descriptor🤖 Generated with Claude Code