[SPARK-33619][SQL] Fix GetMapValueUtil code generation error#30560
[SPARK-33619][SQL] Fix GetMapValueUtil code generation error#30560leanken-zz wants to merge 4 commits intoapache:masterfrom
Conversation
|
Why were
It's because |
|
@cloud-fan @HyukjinKwon FYI. |
There was a problem hiding this comment.
@leanken, can we add a test?
Currently, this case being missed in SPARK-33460 it is because checkExceptionInExpression is not as expected. And as i investigated, there are some cases would fail if I correct the behavior of checkExceptionInExpression by using withSQLConf set CodeGenFallBack to false, like ObjectExpressionsSuite and RegexpExpressionsSuite and etc.
So I need your advise. Should I
- Fix all these wrong behavior separately and then finally fix checkExceptionInExpression.
- Fix all these wrong behavior and checkExceptionInExpression with the same patch.
The reason why i submit this PR it's because this bug introduced by me and I know of the history, but all those other behavior is fresh to me, and the all-in-one fix might be big.
As for add a test to the java.util.NoSuchElementException, I think the offline manual verification is enough, If we fix checkExceptionInExpression, and make it reliable, then we don't need to check code gen behavior for every new added or updated operation, right?
There was a problem hiding this comment.
@leanken, can we add a test?
maybe you can try reproduce ObjectExpressionsSuite and RegexpExpressionsSuite in your environment so that you can get clearer picture.
There was a problem hiding this comment.
And as i investigated, there are some cases would fail if I correct the behavior of checkExceptionInExpression by using withSQLConf set CodeGenFallBack to false, like ObjectExpressionsSuite and RegexpExpressionsSuite and etc.
How about making a PR to fix checkExceptionInExpression first? I'm currently not sure how many failures caused by it exist. If there are too many failures, we can separate the work to fix them then.
…RK-33460]. Fix code style of [SPARK-33572]. Change-Id: I7744f8bf35e1a10afa7c155b917835a1facdd1ce
be5093a to
6d4fb1d
Compare
|
let's see how many error occurs after I change the |
|
Test build #132019 has finished for PR 30560 at commit
|
Change-Id: Icdd9c60778b9fa155e4b2cb62e2e6d841a43c174
8e4ca3d to
16940ce
Compare
There was a problem hiding this comment.
should remove the entire function, but here we run an entire test to see if there are regressions.
|
Test build #132015 has finished for PR 30560 at commit
|
It seems the five errors? If so, IMO its okay to fix all of them at once. Anyway, nice catch! |
it should be zero error after the final patch 16940ce. please ignore the former test result ^_^ |
Change-Id: I035eca72ebdc6d79676fe14cc79ac4ac2eb4430c
|
Test build #132022 has finished for PR 30560 at commit
|
There was a problem hiding this comment.
For simplicity, can we always test it with 2 modes?
There was a problem hiding this comment.
should be OK. since setting mode does not affect evaluateWithoutCodegen
|
Could you update the title and the description, too? |
OK |
Change-Id: Ifcd5d186c16879159b84223dbc79fcf0ec628c81
update desc and add another UT in ExpressionEvalHelperSuite to make sure the |
|
Test build #132025 has finished for PR 30560 at commit
|
|
retest this please |
|
Test build #132040 has finished for PR 30560 at commit
|
|
thanks, merging to master! |
|
Test build #132047 has finished for PR 30560 at commit
|
|
retest this please |
|
Hi, All. |
|
Thank you @dongjoon-hyun and @LuciferYang for investigating and checking this! |
|
@HyukjinKwon @dongjoon-hyun I will give a pr try to fix this, It seems that there is some wrong with the generated code. But I am not sure why this pr triggered the problem .... |

What changes were proposed in this pull request?
Code Gen bug fix that introduced by SPARK-33460
And the reason why SPARK-33460 failed to detect this bug via UT, it was because that
checkExceptionInExpressiondid not work as expect likecheckEvaluationwhich will try eval expression with BOTHCODEGEN_ONLYandNO_CODEGENmode, and in this PR, will also fix this Test bug, too.Why are the changes needed?
Bug Fix.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Add UT and Existing UT.