backendArchitect commented on code in PR #7795:
URL: https://github.com/apache/datafusion-comet/pull/7795#discussion_r4735702850
##########
spark/src/test/scala/org/apache/comet/exec/CometAggregateSuite.scala:
##########
@@ -3369,6 +3369,63 @@ class CometAggregateSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
}
}
+ test("skip partial aggregation converts decimal AVG rows to partial states")
{
+ withTempDir { dir =>
+ val path = new Path(dir.toURI.toString, "input").toUri.toString
+ withSQLConf(CometConf.COMET_ENABLED.key -> "false") {
+ // Mostly distinct keys, with every 4th key also given to the next
row, so groups of
+ // one and two rows both reach the final aggregate.
+ spark
+ .range(0L, 16384L, 1L, 8)
+ .selectExpr(
+ "id - CAST(id % 4 = 1 AS BIGINT) AS k",
+ "CASE WHEN id % 5 = 0 THEN NULL " +
+ "ELSE CAST(id * 1000003 % 99999999 - 50000000 AS DECIMAL(20, 2))
END AS d",
+ "CAST('9' || repeat('9', 37) AS DECIMAL(38, 0)) AS big")
Review Comment:
Reworked. Since `DECIMAL(38, _)` sums are no longer admitted, the overflow
case moved to the two-task test, which has 200 distinct keys per task before
the two rows, so nothing overflows before skipping starts. The skipping test
now uses `DECIMAL(20,2)` and `DECIMAL(27,2)`, and checks that `DECIMAL(28,2)`
and DOUBLE don't skip.
--
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]