Skip to content

Commit a0ef1dd

Browse files
authored
feat(pojo): add UNSPECIFIED value to AggregationPhase enum (#320)
BREAKING CHANGE: AggregationPhase enum has a new allowed value
1 parent ae59c32 commit a0ef1dd

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

core/src/main/java/io/substrait/expression/Expression.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ public static AggregationInvocation fromProto(AggregateFunction.AggregationInvoc
940940
}
941941

942942
enum AggregationPhase {
943+
UNSPECIFIED(io.substrait.proto.AggregationPhase.AGGREGATION_PHASE_UNSPECIFIED),
943944
INITIAL_TO_INTERMEDIATE(
944945
io.substrait.proto.AggregationPhase.AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE),
945946
INTERMEDIATE_TO_INTERMEDIATE(

spark/src/main/scala/io/substrait/spark/expression/ToAggregateFunction.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ object ToAggregateFunction {
7474
case other => throw new UnsupportedOperationException(s"not currently supported: $other.")
7575
}
7676
def toSpark(phase: SExpression.AggregationPhase): AggregateMode = phase match {
77+
case SExpression.AggregationPhase.UNSPECIFIED =>
78+
Final // UNSPECIFIED implies INTERMEDIATE_TO_RESULT
7779
case SExpression.AggregationPhase.INITIAL_TO_INTERMEDIATE => Partial
7880
case SExpression.AggregationPhase.INTERMEDIATE_TO_INTERMEDIATE => PartialMerge
7981
case SExpression.AggregationPhase.INTERMEDIATE_TO_RESULT => Final

0 commit comments

Comments
 (0)