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-51289][SQL] Throw a proper error message for not fully implemented SQLTableFunction #50073

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

Conversation

wayneguow
Copy link
Contributor

@wayneguow wayneguow commented Feb 25, 2025

What changes were proposed in this pull request?

This PR aims to throw a proper error message for not fully implemented SQLTableFunction.

Why are the changes needed?

Optimize error prompts for the new SQL user-defined functions feature.

Does this PR introduce any user-facing change?

No, this feature has not been released yet.

How was this patch tested?

Add a new test case and Pass GA.
image

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

No.

@github-actions github-actions bot added the SQL label Feb 25, 2025
@wayneguow
Copy link
Contributor Author

cc @MaxGekk @allisonwang-db

@LuciferYang
Copy link
Contributor

also cc @cloud-fan

@@ -34,8 +36,8 @@ object EliminateSQLFunctionNode extends Rule[LogicalPlan] {
plan.transformWithSubqueries {
case SQLFunctionNode(_, child) => child
case f: SQLTableFunction =>
throw SparkException.internalError(
s"SQL table function plan should be rewritten during analysis: $f")
throw QueryCompilationErrors.tableValuedArgumentsNotYetImplementedForSqlFunctions(
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain, please, why do we catch this in the optimizer, but not in the analyzer?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same question. How do we leak SQLTableFunction to the optimizer if we fail earlier in the analyzer/parser?

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.

4 participants