From bedd309b069ceacd5caf16ee2c6e63981112e328 Mon Sep 17 00:00:00 2001 From: Victor Barua Date: Tue, 24 Dec 2024 13:41:51 -0800 Subject: [PATCH] fix(spark): handle AggregationPhase UNSPECIFIED --- .../io/substrait/spark/expression/ToAggregateFunction.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spark/src/main/scala/io/substrait/spark/expression/ToAggregateFunction.scala b/spark/src/main/scala/io/substrait/spark/expression/ToAggregateFunction.scala index 9e959e47e..978287d93 100644 --- a/spark/src/main/scala/io/substrait/spark/expression/ToAggregateFunction.scala +++ b/spark/src/main/scala/io/substrait/spark/expression/ToAggregateFunction.scala @@ -74,6 +74,8 @@ object ToAggregateFunction { case other => throw new UnsupportedOperationException(s"not currently supported: $other.") } def toSpark(phase: SExpression.AggregationPhase): AggregateMode = phase match { + case SExpression.AggregationPhase.UNSPECIFIED => + Final // UNSPECIFIED implies INTERMEDIATE_TO_RESULT case SExpression.AggregationPhase.INITIAL_TO_INTERMEDIATE => Partial case SExpression.AggregationPhase.INTERMEDIATE_TO_INTERMEDIATE => PartialMerge case SExpression.AggregationPhase.INTERMEDIATE_TO_RESULT => Final