fix(datafusion): honor projection in metadata table scan#2820
Open
gmhelmold wants to merge 1 commit into
Open
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
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.
What
IcebergMetadataTableProvider::scan()ignored theprojectionargument:IcebergMetadataScanalways reported the full metadata-table schema and emitted unprojected batches.Closes #2819.
Why
On any populated metadata table, aggregate queries crash and projected queries silently return every column:
Same class as #828, which fixed this for
IcebergTableScan; the metadata provider path was left behind because existing tests only exercise empty metadata tables.Fix
IcebergMetadataScanis now projection-aware, mirroringIcebergTableScan: it carries the projection indices, reports the projected schema in itsPlanProperties, and projects each emittedRecordBatch.scan()passes the projection through.Out of scope (behavior unchanged, correctness preserved because DataFusion applies both on top of the scan):
filtersnever reachscan()(supports_filters_pushdownis not overridden), andlimitremains a missed optimization only.EXPLAINoutput for the metadata scan does not yet render the projection (pre-existing) — happy to add that in a follow-up if wanted.Tests
test_metadata_table_projectionintegration test: aggregate on a populated$snapshots(count(*)— the empty-projection edge) plus a single-column projection.df_inspect_snapshots_manifests: first populated-metadata-table SLT coverage (deterministic columns only), doubling as regression coverage for both failure modes.mainfails the new SLT with the unprojected 12-column$manifestsrow; with the fix the full sqllogictest suite passes (run twice to confirm determinism).