Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-50623][SQL] respect table lookup error from the catalog #49243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

Spark delays the table lookup error as other rules (can be third-party) may be able to resolve the table later. But this has 2 problems today:

  • it swallows table lookup errors from the catalog if the error is NoSuchTableException or NoSuchDatabaseException. At the end, CheckAnalysis always throws NoSuchTableException for UnresolvedRelation.
  • for other table lookup errors, Spark eagerly fails the query, and other analyzer rules have no chance to try.

This PR proposes to cache the table lookup error as a TreeNodeTag in UnresolvedRelation, so that we can throw the original table lookup error in CheckAnalysis.

Why are the changes needed?

improve error message and make analyzer more extensible.

Does this PR introduce any user-facing change?

no

How was this patch tested?

new test

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

no

@github-actions github-actions bot added the SQL label Dec 19, 2024
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.

1 participant