diff --git a/core/src/main/java/io/substrait/expression/Expression.java b/core/src/main/java/io/substrait/expression/Expression.java index 9fc719f35..aa9e69148 100644 --- a/core/src/main/java/io/substrait/expression/Expression.java +++ b/core/src/main/java/io/substrait/expression/Expression.java @@ -940,6 +940,7 @@ public static AggregationInvocation fromProto(AggregateFunction.AggregationInvoc } enum AggregationPhase { + UNSPECIFIED(io.substrait.proto.AggregationPhase.AGGREGATION_PHASE_UNSPECIFIED), INITIAL_TO_INTERMEDIATE( io.substrait.proto.AggregationPhase.AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE), INTERMEDIATE_TO_INTERMEDIATE( 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