Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/19900#discussion_r155220823
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ScalaUDFSuite.scala
---
@@ -47,4 +48,10 @@ class ScalaUDFSuite extends SparkFunSuite with
ExpressionEvalHelper {
assert(e2.getMessage.contains("Failed to execute user defined
function"))
}
+ test("SPARK-22695: ScalaUDF should not use global variables") {
+ val ctx = new CodegenContext
+ ScalaUDF((s: String) => s + "x", StringType, Literal("a") ::
Nil).genCode(ctx)
+ // we have one variable (globalIsNull) introduced by reduceCodeSize
--- End diff --
wow this simple UDF will trigger the code splitting logic in
`reduceCodeSize`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]