parthchandra commented on code in PR #3611:
URL: https://github.com/apache/datafusion-comet/pull/3611#discussion_r3052779142
##########
spark/src/main/scala/org/apache/comet/serde/arrays.scala:
##########
@@ -622,6 +622,80 @@ object CometArrayFilter extends
CometExpressionSerde[ArrayFilter] {
}
}
+object CometArrayExists extends CometExpressionSerde[ArrayExists] {
+
+ override def getSupportLevel(expr: ArrayExists): SupportLevel = {
+ val elementType =
expr.argument.dataType.asInstanceOf[ArrayType].elementType
+ elementType match {
+ case BooleanType | ByteType | ShortType | IntegerType | LongType |
FloatType | DoubleType |
+ _: DecimalType | DateType | TimestampType | TimestampNTZType |
StringType =>
+ Compatible()
+ case _ => Unsupported(Some(s"element type not supported: $elementType"))
+ }
+ }
+
+ override def convert(
+ expr: ArrayExists,
+ inputs: Seq[Attribute],
+ binding: Boolean): Option[ExprOuterClass.Expr] = {
+ val arrayExprProto = exprToProto(expr.argument, inputs, binding)
+ if (arrayExprProto.isEmpty) {
+ withInfo(expr, expr.argument)
+ return None
+ }
+
+ expr.function match {
+ case LambdaFunction(body, Seq(_: NamedLambdaVariable), _) =>
Review Comment:
For instance, `exists(arr1, x -> exists(arr2, y -> y > x))`, nested lambdas
will probably not work right.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]