diff --git a/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala b/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala index 04b7758f9..d5abd2b60 100644 --- a/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala +++ b/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala @@ -389,27 +389,27 @@ class CometSparkSessionExtensions if (sparkFinalMode) { op } else { - val newOp = transform1(op) - newOp match { - case Some(nativeOp) => - val modes = aggExprs.map(_.mode).distinct - // The aggExprs could be empty. For example, if the aggregate functions only have - // distinct aggregate functions or only have group by, the aggExprs is empty and + val newOp = transform1(op) + newOp match { + case Some(nativeOp) => + val modes = aggExprs.map(_.mode).distinct + // The aggExprs could be empty. For example, if the aggregate functions only have + // distinct aggregate functions or only have group by, the aggExprs is empty and // modes is empty too. If aggExprs is not empty, we need to verify all the // aggregates have the same mode. - assert(modes.length == 1 || modes.length == 0) - CometHashAggregateExec( - nativeOp, - op, - groupingExprs, - aggExprs, - child.output, - if (modes.nonEmpty) Some(modes.head) else None, - child, - SerializedPlan(None)) - case None => - op - } + assert(modes.length == 1 || modes.length == 0) + CometHashAggregateExec( + nativeOp, + op, + groupingExprs, + aggExprs, + child.output, + if (modes.nonEmpty) Some(modes.head) else None, + child, + SerializedPlan(None)) + case None => + op + } } }