Skip to content

Commit c908c7a

Browse files
committed
chore: Output BaseAggregateExec accurate unsupported names
1 parent 3b29cb9 commit c908c7a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,12 +1440,22 @@ object QueryPlanSerde extends Logging with CometExprShim {
14401440
return None
14411441
}
14421442

1443-
val groupingExprs = groupingExpressions.map(exprToProto(_, child.output))
1444-
if (groupingExprs.exists(_.isEmpty)) {
1445-
withInfo(op, "Not all grouping expressions are supported")
1443+
val groupingExprsWithInput =
1444+
groupingExpressions.map(expr => expr.name -> exprToProto(expr, child.output))
1445+
1446+
val emptyExprs = groupingExprsWithInput.collect {
1447+
case (expr, proto) if proto.isEmpty => expr
1448+
}
1449+
1450+
if (emptyExprs.nonEmpty) {
1451+
withInfo(
1452+
op,
1453+
s"Not all grouping expressions are supported. Unsupported: ${emptyExprs.mkString(", ")}")
14461454
return None
14471455
}
14481456

1457+
val groupingExprs = groupingExprsWithInput.map(_._2)
1458+
14491459
// In some of the cases, the aggregateExpressions could be empty.
14501460
// For example, if the aggregate functions only have group by or if the aggregate
14511461
// functions only have distinct aggregate functions:

0 commit comments

Comments
 (0)