Skip to content

Commit d9c2b3a

Browse files
authored
chore: Output BaseAggregateExec accurate unsupported names (#2383)
* chore: Output `BaseAggregateExec` accurate unsupported names
1 parent 79516b6 commit d9c2b3a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,12 +1305,20 @@ object QueryPlanSerde extends Logging with CometExprShim {
13051305
return None
13061306
}
13071307

1308-
val groupingExprs = groupingExpressions.map(exprToProto(_, child.output))
1309-
if (groupingExprs.exists(_.isEmpty)) {
1310-
withInfo(op, "Not all grouping expressions are supported")
1308+
val groupingExprsWithInput =
1309+
groupingExpressions.map(expr => expr.name -> exprToProto(expr, child.output))
1310+
1311+
val emptyExprs = groupingExprsWithInput.collect {
1312+
case (expr, proto) if proto.isEmpty => expr
1313+
}
1314+
1315+
if (emptyExprs.nonEmpty) {
1316+
withInfo(op, s"Unsupported group expressions: ${emptyExprs.mkString(", ")}")
13111317
return None
13121318
}
13131319

1320+
val groupingExprs = groupingExprsWithInput.map(_._2)
1321+
13141322
// In some of the cases, the aggregateExpressions could be empty.
13151323
// For example, if the aggregate functions only have group by or if the aggregate
13161324
// functions only have distinct aggregate functions:

0 commit comments

Comments
 (0)