diff --git a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseTPCDSAbstractSuite.scala b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseTPCDSAbstractSuite.scala index ad4d3b91affb8..6ca587bebc283 100644 --- a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseTPCDSAbstractSuite.scala +++ b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseTPCDSAbstractSuite.scala @@ -57,19 +57,22 @@ abstract class GlutenClickHouseTPCDSAbstractSuite } else { Seq("q" + "%d".format(queryNum)) } - val native = queryNum match { - case i if !isAqe && (i == 10 || i == 16 || i == 35 || i == 94) => - // q10, q35 smj + existence join - // q16 smj + left semi + not condition - // Q94 BroadcastHashJoin, LeftSemi, NOT condition - false - case i if isAqe && (i == 16 || i == 94) => - false - case _ => true - } + val native = !fallbackSets(isAqe).contains(queryNum) sqlNums.map((_, native)) }) + protected def fallbackSets(isAqe: Boolean): Set[Int] = { + val more = if (isSparkVersionGE("3.5")) Set(44, 67, 70) else Set.empty[Int] + + // q16 smj + left semi + not condition + // Q94 BroadcastHashJoin, LeftSemi, NOT condition + if (isAqe) { + Set(16, 94) | more + } else { + // q10, q35 smj + existence join + Set(10, 16, 35, 94) | more + } + } protected def excludedTpcdsQueries: Set[String] = Set( "q66" // inconsistent results ) @@ -82,7 +85,7 @@ abstract class GlutenClickHouseTPCDSAbstractSuite runTPCDSQuery(s._1, noFallBack = s._2) { df => } } } else { - val tag = if (s._2) "Native" else "Vanilla" + val tag = if (s._2) "Native" else "Fallback" test(s"TPCDS[$tag] ${s._1.toUpperCase()}") { runTPCDSQuery(s._1, noFallBack = s._2) { df => } }