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-21619][SQL] Fail the execution of canonicalized plans explicitly #18828

Closed
wants to merge 12 commits into from

Conversation

rxin
Copy link
Contributor

@rxin rxin commented Aug 3, 2017

What changes were proposed in this pull request?

Canonicalized plans are not supposed to be executed. I ran into a case in which there's some code that accidentally calls execute on a canonicalized plan. This patch throws a more explicit exception when that happens.

How was this patch tested?

Added a test case in SparkPlanSuite.

@rxin
Copy link
Contributor Author

rxin commented Aug 3, 2017

cc @adrian-ionescu @gatorsmile

@gatorsmile
Copy link
Member

test this please

@gatorsmile
Copy link
Member

cc @shaneknapp It sounds like we are unable to trigger the test. Could you please check it?

Copy link
Member

@gatorsmile gatorsmile left a comment

Choose a reason for hiding this comment

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

LGTM pending Jenkins.

@SparkQA
Copy link

SparkQA commented Aug 3, 2017

Test build #80187 has finished for PR 18828 at commit 785a569.

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

@SparkQA
Copy link

SparkQA commented Aug 3, 2017

Test build #80190 has finished for PR 18828 at commit 785a569.

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

@rxin
Copy link
Contributor Author

rxin commented Aug 3, 2017

Still looking into it, but the failure is related to reuse exchange and caching.

* This is used solely for making sure we wouldn't execute a canonicalized plan.
* See [[canonicalized]] on how this is set.
*/
@transient
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess plans are already not valid on executors, by why @transient?

@SparkQA
Copy link

SparkQA commented Aug 5, 2017

Test build #80276 has finished for PR 18828 at commit 8f2f91d.

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

@SparkQA
Copy link

SparkQA commented Aug 5, 2017

Test build #80279 has finished for PR 18828 at commit 84e76b9.

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

@SparkQA
Copy link

SparkQA commented Aug 5, 2017

Test build #80280 has finished for PR 18828 at commit 861f255.

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

@gatorsmile
Copy link
Member

gatorsmile commented Aug 5, 2017

There is another zero argument ResetCommand. Do we also need to override the makeCopy function?

intercept[IllegalStateException] { plan.executeCollectPublic() }
intercept[IllegalStateException] { plan.executeToIterator() }
intercept[IllegalStateException] { plan.executeBroadcast() }
intercept[IllegalStateException] { plan.executeTake(1) }
Copy link
Member

Choose a reason for hiding this comment

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

nit. There is an inconsistent corner case in plan.executeTake.

plan.executeTake(1)  -> raise exception
plan.executeTake(0)  -> no exception
plan.executeTake(-1)  -> raise exception

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not an issue with this test, is it? It's just how execution is done.

@gatorsmile
Copy link
Member

ping @rxin

@SparkQA
Copy link

SparkQA commented Oct 28, 2017

Test build #83148 has finished for PR 18828 at commit f8238b1.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 28, 2017

Test build #83149 has finished for PR 18828 at commit 8346e08.

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

@gatorsmile
Copy link
Member

LGTM

Thanks! Merged to master.

@asfgit asfgit closed this in d28d573 Oct 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants