Skip to content

Conversation

aokolnychyi
Copy link
Contributor

@aokolnychyi aokolnychyi commented Sep 25, 2025

What changes were proposed in this pull request?

This PR adds a new extractor for Table from DataSourceV2Relation.

Why are the changes needed?

As we see over time, DataSourceV2Relation continues to evolve and has many args. Frequently, we only need to get the table instance and are not interested in other arguments. Therefore, it makes sense to add a new extractor for this common use case. In particular, I plan to add TimeTravelSpec and I don't want to update a ton of places for no good reason.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

This PR relies on existing tests.

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

No.

override protected def stringArgs: Iterator[Any] = stringArgsVal.iterator
}

object DataSourceV2Table {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Since it extracts v2 table from the relation, i would prefer it to be ExtractV2Table, which makes it explict that it is just an extractor and not a top level class (like org.apache.spark.sql.catalog.Table), and follows other clases like ExtractEquiJoinKeys , ExtractJoinWithBuckets etc

Copy link
Contributor

@karuppayya karuppayya left a comment

Choose a reason for hiding this comment

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

Minor nit, looks good otherwise

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

Successfully merging this pull request may close these issues.

2 participants