diff --git a/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarHashAggregateExec.scala b/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarHashAggregateExec.scala index cb2807ee3..6771ac12a 100644 --- a/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarHashAggregateExec.scala +++ b/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarHashAggregateExec.scala @@ -697,11 +697,12 @@ case class ColumnarHashAggregateExec( case _ => } val internalExpressionList = expr.aggregateFunction.children - for (expr <- internalExpressionList) { - if (expr.isInstanceOf[Literal]) { + for (internalExpr <- internalExpressionList) { + // TODO(yuan): support sum(1) in codegen + if (internalExpr.isInstanceOf[Literal] && expr.aggregateFunction.isInstanceOf[Sum]) { return false } - val colExpr = ColumnarExpressionConverter.replaceWithColumnarExpression(expr) + val colExpr = ColumnarExpressionConverter.replaceWithColumnarExpression(internalExpr) if (!colExpr.asInstanceOf[ColumnarExpression].supportColumnarCodegen( Lists.newArrayList())) { return false diff --git a/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/ds/TPCDSSuite.scala b/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/ds/TPCDSSuite.scala index 5efc338f7..83048b5e5 100644 --- a/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/ds/TPCDSSuite.scala +++ b/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/ds/TPCDSSuite.scala @@ -113,6 +113,10 @@ class TPCDSSuite extends QueryTest with SharedSparkSession { runner.runTPCQuery("q2", 1, true) } + test("q88") { + runner.runTPCQuery("q88", 1, true) + } + test("q2 - shj") { withSQLConf(("spark.oap.sql.columnar.forceshuffledhashjoin", "true")) { runner.runTPCQuery("q2", 1, true)