-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-23628][SQL] calculateParamLength should not return 1 + num of epressions #20772
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
|
I may be wrong, but I do not find algorithm changes in I believe that the original implementation is correct. This is because WDYT? |
|
@kiszk the logic is not changed, but the previous implementation is wrong. Let's go through an example to show more clearly this. Let's assume we have a long nullable variable. Substituting the values, the previous code becomes: Instead it should return 3, as the new code does. This is because Is it clear now? |
|
Yeah, thank you for your explanation. Good catch. |
|
Test build #88094 has finished for PR 20772 at commit
|
|
good catch! merging to master! |
|
@mgaido91 do you mind to open a new PR for 2.3? it conflicts. thanks! |
|
@mgaido91 this is good catch! LGTM. Merging to master/2.3. Thanks! |
|
@cloud-fan you beat me to it :) |
|
haha, 1 minute before you :) |
|
Thanks @cloud-fan @hvanhovell, I'll create a backport for 2.3 tomorrow morning CEST :) |
|
Good catch! Thanks! @mgaido91 |
|
Just wanna leave a note here that the Janino side of the bug has been fixed: |
What changes were proposed in this pull request?
There was a bug in
calculateParamLengthwhich caused it to return always 1 + the number of expressions. This could lead to Exceptions especially with expressions of type long.How was this patch tested?
added UT + fixed previous UT