-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-22549][SQL] Fix 64KB JVM bytecode limit problem with concat_ws #19777
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
|
Test build #83978 has finished for PR 19777 at commit
|
| val varargNum = ctx.freshName("varargNum") | ||
| ctx.addMutableState("int", varargNum, "") | ||
| val idxInVararg = ctx.freshName("idxInVararg") | ||
| ctx.addMutableState("int", idxInVararg, "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do better? I think we can avoid these global variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, you are right. Let me do it later.
| """ | ||
| }, | ||
| _.mkString(s"$varargNum += ", s";\n$varargNum += ", ";")) | ||
| val varargBuilds = ctx.splitExpressions(varargBuild, "varargBuildsConcatWs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we optimize for eval.isNull == "true" in varargCount and varargBuild? since you already did it for the all string cases.
|
Test build #84030 has finished for PR 19777 at commit
|
|
Test build #84034 has finished for PR 19777 at commit
|
## What changes were proposed in this pull request? This PR changes `concat_ws` code generation to place generated code for expression for arguments into separated methods if these size could be large. This PR resolved the case of `concat_ws` with a lot of argument ## How was this patch tested? Added new test cases into `StringExpressionsSuite` Author: Kazuaki Ishizaki <[email protected]> Closes #19777 from kiszk/SPARK-22549. (cherry picked from commit 41c6f36) Signed-off-by: Wenchen Fan <[email protected]>
|
thanks, merging to master/2.2! |
## What changes were proposed in this pull request? This PR changes `concat_ws` code generation to place generated code for expression for arguments into separated methods if these size could be large. This PR resolved the case of `concat_ws` with a lot of argument ## How was this patch tested? Added new test cases into `StringExpressionsSuite` Author: Kazuaki Ishizaki <[email protected]> Closes apache#19777 from kiszk/SPARK-22549. (cherry picked from commit 41c6f36) Signed-off-by: Wenchen Fan <[email protected]>
| val args = ctx.freshName("args") | ||
|
|
||
| val inputs = strings.zipWithIndex.map { case (eval, index) => | ||
| if (eval.isNull != "true") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kiszk I was looking at build warnings and it notes that this compares a ExprValue and String and they will always not be equal. Should it be eval.isNull.code != "true" maybe?
What changes were proposed in this pull request?
This PR changes
concat_wscode generation to place generated code for expression for arguments into separated methods if these size could be large.This PR resolved the case of
concat_wswith a lot of argumentHow was this patch tested?
Added new test cases into
StringExpressionsSuite