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-30148][SQL] Optimize writing plans if there is an analysis exception #26778

Closed
wants to merge 2 commits into from

Conversation

amanomer
Copy link
Contributor

@amanomer amanomer commented Dec 6, 2019

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

@amanomer
Copy link
Contributor Author

amanomer commented Dec 6, 2019

cc @cloud-fan

@cloud-fan
Copy link
Contributor

ok to test

case e: AnalysisException => analysisException = e.toString
}
if (analysisException.size > 0) {
QueryPlan.append(analyzed, append, verbose, addSuffix, maxFields)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure.

@SparkQA
Copy link

SparkQA commented Dec 6, 2019

Test build #114939 has finished for PR 26778 at commit f9e3366.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@amanomer
Copy link
Contributor Author

amanomer commented Dec 6, 2019

cc @cloud-fan @HeartSaVioR

@SparkQA
Copy link

SparkQA commented Dec 6, 2019

Test build #114941 has finished for PR 26778 at commit 44f09e0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

Merged to master.

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