@@ -1180,14 +1180,12 @@ class CometAggregateSuite extends CometTestBase with AdaptiveSparkPlanHelper {
11801180 }
11811181 }
11821182
1183- // TODO enable once https://github.com/apache/datafusion-comet/issues/1267 is implemented
1184- ignore(" distinct" ) {
1183+ test(" distinct" ) {
11851184 withSQLConf(CometConf .COMET_EXEC_SHUFFLE_ENABLED .key -> " true" ) {
11861185 Seq (" native" , " jvm" ).foreach { cometShuffleMode =>
11871186 withSQLConf(CometConf .COMET_SHUFFLE_MODE .key -> cometShuffleMode) {
11881187 Seq (true , false ).foreach { dictionary =>
11891188 withSQLConf(" parquet.enable.dictionary" -> dictionary.toString) {
1190- val cometColumnShuffleEnabled = cometShuffleMode == " jvm"
11911189 val table = " test"
11921190 withTable(table) {
11931191 sql(s " create table $table(col1 int, col2 int, col3 int) using parquet " )
@@ -1196,38 +1194,25 @@ class CometAggregateSuite extends CometTestBase with AdaptiveSparkPlanHelper {
11961194
11971195 var expectedNumOfCometAggregates = 2
11981196
1199- checkSparkAnswerAndNumOfAggregates(
1200- s " SELECT DISTINCT(col2) FROM $table" ,
1201- expectedNumOfCometAggregates)
1202-
1203- expectedNumOfCometAggregates = 4
1197+ checkSparkAnswerAndOperator(s " SELECT DISTINCT(col2) FROM $table" )
12041198
1205- checkSparkAnswerAndNumOfAggregates(
1206- s " SELECT COUNT(distinct col2) FROM $table" ,
1207- expectedNumOfCometAggregates)
1199+ checkSparkAnswerAndOperator(s " SELECT COUNT(distinct col2) FROM $table" )
12081200
1209- checkSparkAnswerAndNumOfAggregates(
1210- s " SELECT COUNT(distinct col2), col1 FROM $table group by col1 " ,
1211- expectedNumOfCometAggregates)
1201+ checkSparkAnswerAndOperator(
1202+ s " SELECT COUNT(distinct col2), col1 FROM $table group by col1 " )
12121203
1213- checkSparkAnswerAndNumOfAggregates(
1214- s " SELECT SUM(distinct col2) FROM $table" ,
1215- expectedNumOfCometAggregates)
1204+ checkSparkAnswerAndOperator(s " SELECT SUM(distinct col2) FROM $table" )
12161205
1217- checkSparkAnswerAndNumOfAggregates(
1218- s " SELECT SUM(distinct col2), col1 FROM $table group by col1 " ,
1219- expectedNumOfCometAggregates)
1206+ checkSparkAnswerAndOperator(
1207+ s " SELECT SUM(distinct col2), col1 FROM $table group by col1 " )
12201208
1221- checkSparkAnswerAndNumOfAggregates (
1209+ checkSparkAnswerAndOperator (
12221210 " SELECT COUNT(distinct col2), SUM(distinct col2), col1, COUNT(distinct col2)," +
1223- s " SUM(distinct col2) FROM $table group by col1 " ,
1224- expectedNumOfCometAggregates)
1211+ s " SUM(distinct col2) FROM $table group by col1 " )
12251212
1226- expectedNumOfCometAggregates = if (cometColumnShuffleEnabled) 2 else 1
1227- checkSparkAnswerAndNumOfAggregates(
1213+ checkSparkAnswerAndOperator(
12281214 " SELECT COUNT(col2), MIN(col2), COUNT(DISTINCT col2), SUM(col2)," +
1229- s " SUM(DISTINCT col2), COUNT(DISTINCT col2), col1 FROM $table group by col1 " ,
1230- expectedNumOfCometAggregates)
1215+ s " SUM(DISTINCT col2), COUNT(DISTINCT col2), col1 FROM $table group by col1 " )
12311216 }
12321217 }
12331218 }
0 commit comments