Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/19767#discussion_r152441210
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala
---
@@ -64,52 +64,22 @@ case class If(predicate: Expression, trueValue:
Expression, falseValue: Expressi
val trueEval = trueValue.genCode(ctx)
val falseEval = falseValue.genCode(ctx)
- // place generated code of condition, true value and false value in
separate methods if
- // their code combined is large
- val combinedLength = condEval.code.length + trueEval.code.length +
falseEval.code.length
--- End diff --
There is no way to guarantee it with the current string based codegen
framework, even without this PR. 1000 length code may also generate 64kb byte
code in the end.
`1024` is not a good estimation at all, kind of random to me. So
multiplying it with 2 doesn't seem a big issue. CASE WHEN may have issue.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]