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-30148][SQL] Optimize writing plans if there is an analysis exception #26778
Conversation
cc @cloud-fan |
ok to test |
sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala
Show resolved
Hide resolved
case e: AnalysisException => analysisException = e.toString | ||
} | ||
if (analysisException.size > 0) { | ||
QueryPlan.append(analyzed, append, verbose, addSuffix, maxFields) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statements for if and else seems to be swapped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we move this to try-catch (as @cloud-fan suggested), we don't need if-else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
Test build #114939 has finished for PR 26778 at commit
|
Test build #114941 has finished for PR 26778 at commit
|
Merged to master. |
What changes were proposed in this pull request?
Optimized QueryExecution.scala#writePlans().
Why are the changes needed?
If any query fails in Analysis phase and gets AnalysisException, there is no need to execute further phases since those will return a same result i.e, AnalysisException.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Manually