sunchao commented on code in PR #5558:
URL: https://github.com/apache/datafusion-comet/pull/5558#discussion_r3916755645


##########
spark/src/main/scala/org/apache/comet/serde/arrays.scala:
##########
@@ -352,7 +350,9 @@ object CometArrayJoin
     if (hasNonDefaultStringCollation(expr.array.dataType)) {
       Incompatible(Some(collationReason))
     } else {
-      Incompatible(Some(incompatReason))
+      // Null handling matched Spark once the nullReplacement guard in 
convert() landed (#3178);
+      // collation is the only remaining deviation.
+      Compatible()

Review Comment:
   [P2] Follow-up on the remaining null-array case
   
   Thanks, the original column-based delimiter example is guarded now. Could 
the guard selection also distinguish literal values from surviving foldable 
expressions? With Parquet columns `flag = true` and `arr = NULL`, consider 
`SELECT IF(flag, array_join(arr, element_at(array(','), 0)), NULL) FROM t`. 
Spark's `ConstantFolding` deliberately retains a foldable expression that 
throws inside a conditional branch, so this does not require disabling the 
optimizer. The delimiter remains foldable, which makes the new 
`afterArray.exists(!_.foldable)` test omit the array guard. Spark's 
two-argument generated path returns NULL without evaluating it, while the 
native scalar-function path evaluates `ListExtract` and raises 
`INVALID_INDEX_OF_ZERO`.
   
   Could the guard also protect a surviving foldable delimiter, with a 
regression using normal constant folding? This is the remaining part of this 
null-array issue, based on the maintained Spark 3.5/4.0 sources and the current 
native path. I have not executed the query.



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