wForget commented on code in PR #2747:
URL: https://github.com/apache/datafusion-comet/pull/2747#discussion_r2508919198


##########
spark/src/main/scala/org/apache/comet/serde/CometAggregate.scala:
##########
@@ -133,8 +133,15 @@ trait CometBaseAggregate {
 
       val aggExprs =
         aggregateExpressions.map(aggExprToProto(_, output, binding, 
aggregate.conf))
-      if (childOp.nonEmpty && groupingExprs.forall(_.isDefined) &&
-        aggExprs.forall(_.isDefined)) {
+      if (aggExprs.exists(_.isEmpty)) {

Review Comment:
   `0.0` and `-0.0` become `0.0` after grouping.
   
   test case:
   ```
     test("test group") {
       withSQLConf(
         CometConf.COMET_SPARK_TO_ARROW_ENABLED.key -> "true",
         CometConf.COMET_SPARK_TO_ARROW_SUPPORTED_OPERATOR_LIST.key -> 
"LocalTableScan",
         CometConf.COMET_EXEC_SHUFFLE_ENABLED.key -> "true"
       ) {
         val q1 = "SELECT col1, first(col1) FROM VALUES (-0.0f), (0.0f) group 
by col1"
         sql(q1).show()
         checkSparkAnswer(q1)
   
         val q2 = "SELECT col1, first(col1) FROM VALUES (0.0f), (-0.0f) group 
by col1"
         sql(q2).show()
         checkSparkAnswer(q2)
       }
     }
   ```
   
   output:
   ```
   +----+-----------+
   |col1|first(col1)|
   +----+-----------+
   | 0.0|       -0.0|
   +----+-----------+
   
   +----+-----------+
   |col1|first(col1)|
   +----+-----------+
   | 0.0|        0.0|
   +----+-----------+
   
   ```



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