Uh oh!
There was an error while loading. Please reload this page.
[SPARK-25308][SQL] ArrayContains function may return a error in the code generation phase. - #22315
[SPARK-25308][SQL] ArrayContains function may return a error in the code generation phase.#22315dilipbiswal wants to merge 5 commits into
Conversation
SparkQA
commented
Sep 2, 2018
Test build #95586 has finished for PR 22315 at commit
|
dilipbiswal
commented
Sep 2, 2018
retest this please |
There was a problem hiding this comment.
The fix LGTM, just some minor comments to address. We might want to add a test for non-nullable types to all operators. Probably we can create an helper for this in order to avoid this issue in the future. What do you think? cc @cloud-fan@gatorsmile
SparkQA
commented
Sep 2, 2018
Test build #95587 has finished for PR 22315 at commit
|
There was a problem hiding this comment.
Could you update this part based on this comment instead of if (...) { ... } else?
kiszk
commented
Sep 2, 2018
Thank you |
SparkQA
commented
Sep 2, 2018
Test build #95589 has finished for PR 22315 at commit
|
SparkQA
commented
Sep 2, 2018
Test build #95593 has finished for PR 22315 at commit
|
There was a problem hiding this comment.
How about the case right.nullable = true andleft.nullable = false AND left.dataType.asInstanceOf[ArrayType].containsNull = false?
There was a problem hiding this comment.
@maropu This should be rejected in checkInputDataTypes(), no ?
There was a problem hiding this comment.
nit: How about def checkAndSetIsNullCode(body: String) = if (nullable) {?
There was a problem hiding this comment.
This seems too complicated to save a few duplicated code, how about
val loopBody = if (nullable) {
s"""
|if ($arr.isNullAt($i)) {
| ${ev.isNull} = true;
|} else ...
"""
} else {
s"""
|if (${ctx.genEqual(right.dataType, value, getValue)}) {...
"""
}
SparkQA
commented
Sep 3, 2018
Test build #95608 has finished for PR 22315 at commit
|
SparkQA
commented
Sep 3, 2018
Test build #95634 has finished for PR 22315 at commit
|
dilipbiswal
commented
Sep 3, 2018
retest this please |
SparkQA
commented
Sep 3, 2018
Test build #95636 has finished for PR 22315 at commit
|
712542c to
59ddb99Comparecloud-fan
commented
Sep 4, 2018
LGTM |
SparkQA
commented
Sep 4, 2018
Test build #95638 has finished for PR 22315 at commit
|
ueshin
commented
Sep 4, 2018
LGTM. |
ueshin
commented
Sep 4, 2018
Thanks! merging to master. |
gatorsmile
commented
Sep 4, 2018
@dilipbiswal Could we also add the test cases for the other high-order functions, if missing? |
dilipbiswal
commented
Sep 4, 2018
@gatorsmile Sure.. I will check and add. |
ueshin
commented
Sep 4, 2018
@dilipbiswal Do we need to backport this to 2.3? If so, could you submit a backport pr to branch-2.3 please? Thanks! |
dilipbiswal
commented
Sep 4, 2018
@ueshin Just verified in 2.3. This problem does not exist in 2.3. This is due to the fact that implementation of nullSafeCodeGen is different in 2.3 than in master. However, we are missing the test cases we added in these PRs in 2.3. Should we have the test cases checked in into the branch ? I am afraid that if we ever backported the pr that changed nullSafeCodeGen , we may introduce this bug. Please advise .. |
ueshin
commented
Sep 4, 2018
@dilipbiswal Thanks for the verification! I don't think we will backport the |
What changes were proposed in this pull request?
Invoking ArrayContains function with non nullable array type throws the following error in the code generation phase. Below is the error snippet.
How was this patch tested?
Added test in CollectionExpressionSuite.