Resolve ListingScan
projection against table schema including partition columns
#106
+28
−19
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.
Which issue does this PR close?
TBD
Rationale for this change
Since table partition columns are serialized separately for ListingScan, apache#15737 made a change to remove them from the
TableScan
schema so they would not be duplicated. Unfortunately, queries with projections that reference the partition columns would fail to resolve here:https://github.com/apache/datafusion/blob/daeb6597a0c7344735460bb2dce13879fd89d7bd/datafusion/proto/src/logical_plan/mod.rs#L382-L390
The round-trip test used a partition column in its
SELECT
to exercise this, however the unoptimized plan did not have projections decorated (so they would not get serialized, and there would be no lookup to fail). As in,scan.projection
above would beNone
.What changes are included in this PR?
ListingTable::schema
, at which point the partition columns are decoratedLogicalPlanBuilder
that explicitly specifies a projection to ensure we're testing this functionalitymain
Upstream apache#17911