mbutrovich commented on code in PR #4003:
URL: https://github.com/apache/datafusion-comet/pull/4003#discussion_r3150342646
##########
spark/src/test/scala/org/apache/comet/exec/CometAggregateSuite.scala:
##########
@@ -1108,54 +1189,37 @@ class CometAggregateSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
}
}
- // TODO enable once https://github.com/apache/datafusion-comet/issues/1267
is implemented
- ignore("distinct") {
+ test("distinct") {
withSQLConf(CometConf.COMET_EXEC_SHUFFLE_ENABLED.key -> "true") {
Seq("native", "jvm").foreach { cometShuffleMode =>
withSQLConf(CometConf.COMET_SHUFFLE_MODE.key -> cometShuffleMode) {
Seq(true, false).foreach { dictionary =>
withSQLConf("parquet.enable.dictionary" -> dictionary.toString) {
- val cometColumnShuffleEnabled = cometShuffleMode == "jvm"
val table = "test"
withTable(table) {
sql(s"create table $table(col1 int, col2 int, col3 int) using
parquet")
sql(
s"insert into $table values(1, 1, 1), (1, 1, 1), (1, 3, 1),
(1, 4, 2), (5, 3, 2)")
- var expectedNumOfCometAggregates = 2
-
- checkSparkAnswerAndNumOfAggregates(
- s"SELECT DISTINCT(col2) FROM $table",
- expectedNumOfCometAggregates)
-
- expectedNumOfCometAggregates = 4
+ checkSparkAnswerAndOperator(s"SELECT DISTINCT(col2) FROM
$table")
- checkSparkAnswerAndNumOfAggregates(
- s"SELECT COUNT(distinct col2) FROM $table",
- expectedNumOfCometAggregates)
+ checkSparkAnswerAndOperator(s"SELECT COUNT(distinct col2) FROM
$table")
- checkSparkAnswerAndNumOfAggregates(
- s"SELECT COUNT(distinct col2), col1 FROM $table group by
col1",
- expectedNumOfCometAggregates)
+ checkSparkAnswerAndOperator(
+ s"SELECT COUNT(distinct col2), col1 FROM $table group by
col1")
- checkSparkAnswerAndNumOfAggregates(
- s"SELECT SUM(distinct col2) FROM $table",
- expectedNumOfCometAggregates)
+ checkSparkAnswerAndOperator(s"SELECT SUM(distinct col2) FROM
$table")
- checkSparkAnswerAndNumOfAggregates(
- s"SELECT SUM(distinct col2), col1 FROM $table group by col1",
- expectedNumOfCometAggregates)
+ checkSparkAnswerAndOperator(
+ s"SELECT SUM(distinct col2), col1 FROM $table group by col1")
- checkSparkAnswerAndNumOfAggregates(
+ checkSparkAnswerAndOperator(
"SELECT COUNT(distinct col2), SUM(distinct col2), col1,
COUNT(distinct col2)," +
- s" SUM(distinct col2) FROM $table group by col1",
- expectedNumOfCometAggregates)
+ s" SUM(distinct col2) FROM $table group by col1")
- expectedNumOfCometAggregates = if (cometColumnShuffleEnabled)
2 else 1
- checkSparkAnswerAndNumOfAggregates(
+ checkSparkAnswerAndOperator(
Review Comment:
Can we not use `checkSparkAnswerAndNumOfAggregates` anymore?
--
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]