Skip to content

Conversation

@cloud-fan
Copy link
Contributor

@cloud-fan cloud-fan commented Mar 8, 2024

What changes were proposed in this pull request?

This is a follow-up of #43949 to fix a breaking change. Spark allows people to provide a custom session catalog, which may return custom v2 tables based on the table provider. #43949 resolves the table provider earlier than the custom session catalog, and may break custom session catalogs. This PR fixes it by not resolving table provider if custom session catalog is present.

Why are the changes needed?

avoid breaking custom session catalogs

Does this PR introduce any user-facing change?

no, #43949 is not released yet.

How was this patch tested?

existing tests

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

no

@github-actions github-actions bot added the SQL label Mar 8, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still confused about why we need to separate this function from loadTable. How could a custom session catalog table fail to be resolved?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a custom v2 session catalog can extend DelegatingCatalogExtension and take the Table returned by V2SessionCatalog.loadTable then return something else. That said, we should keep V2SessionCatalog.loadTable to return V1Table and resolve data source v2 table provider afterwards, which is after calling CatalogV2Utils.loadTable

@cloud-fan cloud-fan changed the title [SPARK-46043][SQL][FOLLOWUP] Resolve ds v2 table after custom session catalog is applied [SPARK-46043][SQL][FOLLOWUP] do not resolve v2 table provider with custom session catalog Mar 11, 2024
@yaooqinn yaooqinn closed this in 09bdf2a Mar 12, 2024
@yaooqinn
Copy link
Member

Merged to master

Thank you @cloud-fan @allisonwang-db

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