Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1440,12 +1440,20 @@ object QueryPlanSerde extends Logging with CometExprShim {
return None
}

val groupingExprs = groupingExpressions.map(exprToProto(_, child.output))
if (groupingExprs.exists(_.isEmpty)) {
withInfo(op, "Not all grouping expressions are supported")
val groupingExprsWithInput =
groupingExpressions.map(expr => expr.name -> exprToProto(expr, child.output))

val emptyExprs = groupingExprsWithInput.collect {
case (expr, proto) if proto.isEmpty => expr
}

if (emptyExprs.nonEmpty) {
withInfo(op, s"Unsupported group expressions: ${emptyExprs.mkString(", ")}")
return None
}

val groupingExprs = groupingExprsWithInput.map(_._2)

// In some of the cases, the aggregateExpressions could be empty.
// For example, if the aggregate functions only have group by or if the aggregate
// functions only have distinct aggregate functions:
Expand Down
Loading