andygrove commented on code in PR #981:
URL: https://github.com/apache/datafusion-comet/pull/981#discussion_r1793674874


##########
spark/src/test/scala/org/apache/comet/exec/CometAggregateSuite.scala:
##########
@@ -1202,6 +1202,28 @@ class CometAggregateSuite extends CometTestBase with 
AdaptiveSparkPlanHelper {
     }
   }
 
+  test("sum decimal and average decimal overflow with ansi true") {
+    withSQLConf(
+      SQLConf.ANSI_ENABLED.key -> "true",
+      CometConf.COMET_ANSI_MODE_ENABLED.key -> "true",
+      CometConf.COMET_CAST_ALLOW_INCOMPATIBLE.key -> "true") {
+      Seq(true, false).foreach { dictionary =>
+        withSQLConf("parquet.enable.dictionary" -> dictionary.toString) {
+          val table = "test"
+          withTable(table) {
+            sql(s"create table $table(col1 decimal(5, 2), col2 decimal(5, 2)) 
using parquet")
+            sql(s"""
+            insert into $table values
+            (-999.99, 999.99),
+            (-999.99, 999.99)
+          """)
+            checkSparkAnswer("SELECT SUM(col1), AVG(col1), SUM(col2), 
AVG(col2) FROM test")

Review Comment:
   We should use `checkSparkAnswerAndOperator` here to make sure that the Comet 
query really is running with Comet expressions.
   
   ```suggestion
               checkSparkAnswerAndOperator("SELECT SUM(col1), AVG(col1), 
SUM(col2), AVG(col2) FROM test")
   ```



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