comphead commented on code in PR #4720:
URL: https://github.com/apache/datafusion-comet/pull/4720#discussion_r3604312544


##########
spark/src/main/scala/org/apache/comet/serde/aggregates.scala:
##########
@@ -858,13 +858,19 @@ object CometCollectSet extends 
CometAggregateExpressionSerde[CollectSet] {
       " `spark.comet.expression.CollectSet.allowIncompatible=true` is set.")
 
   override def getSupportLevel(expr: CollectSet): SupportLevel = {
-    SupportLevel
-      .strictFloatingPointReason(
-        expr.children.head.dataType,
-        "collect_set on floating-point types " +
-          "(Comet deduplicates NaN values while Spark treats each NaN as 
distinct)")
-      .map(reason => Incompatible(Some(reason)))
-      .getOrElse(Compatible())
+    // The native path always drops null inputs. Spark 4.2 adds `RESPECT NULLS`
+    // (`ignoreNulls = false`), which keeps nulls, so fall back there.
+    if (!CometCollectShim.ignoreNulls(expr)) {

Review Comment:
   this code is confusing 
   
   ```
   spark.sql("SELECT collect_list(c) IGNORE NULLS FROM VALUES (1),(NULL) AS 
t(c);").show(false)
   org.apache.spark.sql.AnalysisException: 
[INVALID_SQL_SYNTAX.FUNCTION_WITH_UNSUPPORTED_SYNTAX] Invalid SQL syntax: The 
function `collect_list` does not support IGNORE NULLS.
   ```
   
   it is always dead code



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