kazantsev-maksim commented on code in PR #3036:
URL: https://github.com/apache/datafusion-comet/pull/3036#discussion_r2671004775


##########
spark/src/main/scala/org/apache/comet/serde/arrays.scala:
##########
@@ -546,26 +546,55 @@ object CometArrayFilter extends 
CometExpressionSerde[ArrayFilter] {
 object CometSize extends CometExpressionSerde[Size] {
 
   override def getSupportLevel(expr: Size): SupportLevel = {
-    // TODO respect spark.sql.legacy.sizeOfNull
     expr.child.dataType match {
       case _: ArrayType => Compatible()
       case _: MapType => Unsupported(Some("size does not support map inputs"))
       case other =>
         // this should be unreachable because Spark only supports map and 
array inputs
         Unsupported(Some(s"Unsupported child data type: $other"))
     }
-
   }
 
   override def convert(
       expr: Size,
       inputs: Seq[Attribute],
       binding: Boolean): Option[ExprOuterClass.Expr] = {
     val arrayExprProto = exprToProto(expr.child, inputs, binding)
+    for {
+      isNotNullExprProto <- createIsNotNullExprProto(expr, inputs, binding)
+      sizeScalarExprProto <- scalarFunctionExprToProto("size", arrayExprProto)
+      emptyLiteralExprProto <- createLiteralExprProto(expr.legacySizeOfNull)

Review Comment:
   For more safety use - SQLConf.get.legacySizeOfNull
   
   <img width="512" height="84" alt="image" 
src="https://github.com/user-attachments/assets/19622a9f-dd22-46d5-8768-a29558f47d87";
 />
   



-- 
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]

Reply via email to