Skip to content

Commit 73b3167

Browse files
committed
fix: use functionForEval to unify lambda variable references
The raw LambdaFunction body may contain a different NamedLambdaVariable instance than the one extracted from arguments. Using functionForEval (as Spark does internally) ensures the variable we set is the same instance the body reads from.
1 parent 53cd983 commit 73b3167

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

common/src/main/scala/org/apache/comet/udf/ArrayExistsUDF.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class ArrayExistsUDF extends CometUDF {
5656
val registryKey = new String(keyVec.get(0), StandardCharsets.UTF_8)
5757
val arrayExistsExpr = CometLambdaRegistry.get(registryKey).asInstanceOf[ArrayExists]
5858

59-
val LambdaFunction(body, Seq(elementVar: NamedLambdaVariable), _) = arrayExistsExpr.function
59+
val LambdaFunction(_, Seq(elementVar: NamedLambdaVariable), _) = arrayExistsExpr.function
60+
val body = arrayExistsExpr.functionForEval
6061
val followThreeValuedLogic = arrayExistsExpr.followThreeValuedLogic
6162
val elementType = elementVar.dataType
6263

0 commit comments

Comments
 (0)