-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-27246][SQL] Add an assert on invalid Scalar subquery plan with no column #24182
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
Conversation
|
What's the relationship between this and #24136? |
|
"scalar subquery with no column" UT is failing Reason: |
|
can refer the UT failure report Jenkins Report |
|
ok to test |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala
Outdated
Show resolved
Hide resolved
If the failure is caused by the change of #24136, we should put this fix there? |
Failure is not caused by #24136 , it's an existing issue which recovered while fixing |
|
Test build #103882 has finished for PR 24182 at commit
|
|
Ah, I see. Could you add the tests that don't depend on a log level? |
|
@sandeep-katta @maropu |
|
Test build #103884 has finished for PR 24182 at commit
|
|
Yea, adding an assert or throwing an exception should be better. Want to see if that's possible too. So wanted to check which test case is failed for what reason. Can you pull it out @sandeep-katta? |
|
Failed test case Jenkins Report Caused by: sbt.ForkMain$ForkError: java.util.NoSuchElementException: next on empty iterator |
|
@HyukjinKwon From one of sandeep's comment i gathered that this is the test (in AnalysisErrorSuite) thats failing : Here we are purposely setting up an ScalarSubquery expression op top of a relation with 0 length scema. If we run this test normally it passes. But if we turn on plan debugging it fails. |
|
Thanks. Removing test and adding an assert looks better to me too. |
|
SGTM, too |
20ef5db to
1223fd0
Compare
|
Looks good to me. |
13ae066 to
726d864
Compare
|
Test build #103902 has finished for PR 24182 at commit
|
726d864 to
459914c
Compare
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisErrorSuite.scala
Outdated
Show resolved
Hide resolved
|
LGTM too, otherwise. For PR description, I have updated by myself but let's keep the PR description detailed and more readable next time. |
459914c to
cfc2935
Compare
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
cfc2935 to
37ee7d6
Compare
|
Test build #103901 has finished for PR 24182 at commit
|
|
Test build #103903 has finished for PR 24182 at commit
|
|
Test build #103910 has finished for PR 24182 at commit
|
|
Merged to master. |
What changes were proposed in this pull request?
This PR proposes to add an assert on
ScalarSubquery'sdataTypebecause there's a possibility thatdataTypecan be called alone before throwing analysis exception.This was found while working on SPARK-27088. This change calls
treeStringfor logging purpose, and the specific test "scalar subquery with no column" underAnalysisErrorSuitewas being failed with:The reason is that
treeStringfor logging happened to calldataTypeonScalarSubquerybut one test has empty column plan. So, it happened to throwNoSuchElementExceptionbefore checking analysis.How was this patch tested?
Manually tested.