Skip to content

Conversation

huaxingao
Copy link
Contributor

What changes were proposed in this pull request?

Push Variant into DSv2 scan

Why are the changes needed?

with the change, DSV2 scan only needs to fetch the necessary shredded columns required by the plan

Does this PR introduce any user-facing change?

No

How was this patch tested?

new tests

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Oct 6, 2025
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much, @huaxingao .

cc @chenhao-db and @cloud-fan from SPARK-53805 .

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM from my side.

@dongjoon-hyun
Copy link
Member

cc @peter-toth , too.

hadoopFsRelation@HadoopFsRelation(_, _, _, _, _: ParquetFileFormat, _), _)) =>
rewritePlan(p, projectList, filters, relation, hadoopFsRelation)
case p@PhysicalOperation(projectList, filters, relation: DataSourceV2Relation) =>
rewriteV2RelationPlan(p, projectList, filters, relation.output, relation)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are sending the relation already do we need to send the relation.output seperately ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I overlooked this. Removed.

SchemaPruning,
GroupBasedRowLevelOperationScanPlanning,
V1Writes,
PushVariantIntoScan,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now PushVariantIntoScan runs before the PruneFileSourcePartition, which i think was for v1 sources, does this matter or if i were to ask did we just like add in later, just because it was a new rule ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think variant columns will ever be used in the partition schema. Schema transformations by PushVariantIntoScan shouldn't affect partition pruning in v1 sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants