Skip to content

Commit 8ab1933

Browse files
committed
[SPARK-35829][SQL][FOLLOWUP] Use subExprCode to avoid duplicate call of addNewFunction
### What changes were proposed in this pull request? A followup of #32980. We should use `subExprCode` to avoid duplicate call of `addNewFunction`. ### Why are the changes needed? Avoid duplicate all of `addNewFunction`. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing test. Closes #33305 from viirya/fix-minor. Authored-by: Liang-Chi Hsieh <viirya@gmail.com> Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>
1 parent e2021da commit 8ab1933

File tree

1 file changed

+1
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen

1 file changed

+1
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ class CodegenContext extends Logging {
12491249
// at least two nodes) as the cost of doing it is expected to be low.
12501250

12511251
val subExprCode = s"${addNewFunction(fnName, fn)}($INPUT_ROW);"
1252-
subexprFunctions += s"${addNewFunction(fnName, fn)}($INPUT_ROW);"
1252+
subexprFunctions += subExprCode
12531253
val state = SubExprEliminationState(
12541254
ExprCode(code"$subExprCode",
12551255
JavaCode.isNullGlobal(isNull),

0 commit comments

Comments
 (0)