Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pojo): add UNSPECIFIED value to AggregationPhase enum #320

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mbwhite
Copy link
Contributor

@mbwhite mbwhite commented Nov 29, 2024

Resolves issue #319

@EpsilonPrime EpsilonPrime changed the title Update to support the Aggregate Phase Unspecified feat: Support Unspecified Aggregate Phases Dec 2, 2024
@@ -940,6 +940,7 @@ public static AggregationInvocation fromProto(AggregateFunction.AggregationInvoc
}

enum AggregationPhase {
UNSPECIFIED(io.substrait.proto.AggregationPhase.AGGREGATION_PHASE_UNSPECIFIED),
Copy link
Member

@EpsilonPrime EpsilonPrime Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are probably a lot of switches that need to be updated as appropriate. A search for INITIAL_TO_RESULT found many potential instances across Java and Scala.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enumerations here are mapping from the protobuf enumerations; in this case here one of the valid values in the protobuf was missing from the Java enumerations;

If a plan contained that it would fail immediately; which in the case of a plan coming from duckdb it did.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are probably a lot of switches that need to be updated as appropriate.

There's actually a Java warning enabled for exhaustive switch statements, which should trigger CI failures. I didn't see any pattern matching blocks in Java which would be affected.

I did find one in Scala running ./gradlew check locally. I filed #321 for the fact that it didn't fail in CI.

@vbarua
Copy link
Member

vbarua commented Dec 24, 2024

@mbwhite I found one block in the Scala code missing a pattern for the UNSPECIFIED, which I've added. If my changes look good to you I can merge this in.

@vbarua vbarua changed the title feat: Support Unspecified Aggregate Phases feat(pojo): add UNSPECIFIED value to AggregationPhase enum Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants