Skip to content

fix(isthmus): adding support for new proto and deprecated form in AggregateRel#521

Merged
vbarua merged 13 commits into
substrait-io:mainfrom
gord02:gordon.hamilton/aggregateGroupingNewSubstraitForm
Oct 3, 2025
Merged

fix(isthmus): adding support for new proto and deprecated form in AggregateRel#521
vbarua merged 13 commits into
substrait-io:mainfrom
gord02:gordon.hamilton/aggregateGroupingNewSubstraitForm

Conversation

@gord02

@gord02 gord02 commented Sep 24, 2025

Copy link
Copy Markdown
Contributor

Substrait is either produced using using the deprecated form where Groupings is set with a grouping_expressions list, or the new proto form where the grouping_expressions is defined on the AggregateRel itself with the Groupings having a list of references into the grouping_expressions list.

This PR would add support for both of these forms resolving bugs that expected the deprecated form of AggregateRel.

Key Changes:

  • added check for deprecated and new form of proto in ProtoRelConverter
  • Added support for both proto forms to be outputted in RelProtoConverter
  • added tests for checking both forms of proto and some lines for checking the output of RelProtoConverter

@CLAassistant

CLAassistant commented Sep 24, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@vbarua
vbarua self-requested a review September 25, 2025 04:07

@vbarua vbarua left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For future readers, the context of this change arise from:
substrait-io/substrait#700
substrait-io/substrait#706

Thanks for starting on this. It would be good to have some tests for this. I would suggest adding a new test class like AggregateRelTest extends TestBase in this directory. Things to test would include consuming a proto plan with only the deprecated aggregate encoding and consuming a proto plan with the new aggregate encoding.

Beyond this, it might be good to consider updating the RelProtoConverter to output the new format as well For migration purposes, we should set both the new fields alongside the existing ones so that consuming systems can use whichever they support. This might require updating the Aggregate class itself to better align with the new representation.

@gord02
gord02 requested a review from vbarua September 29, 2025 21:08
…ithub.com:gord02/substrait-java into gordon.hamilton/aggregateGroupingNewSubstraitForm
@vbarua
vbarua force-pushed the gordon.hamilton/aggregateGroupingNewSubstraitForm branch from dfd50eb to 0a13b15 Compare October 2, 2025 03:19
Comment thread core/src/main/java/io/substrait/relation/ProtoRelConverter.java Outdated
Comment thread core/src/main/java/io/substrait/relation/ProtoRelConverter.java Outdated
Comment thread core/src/main/java/io/substrait/relation/RelProtoConverter.java Outdated
Comment thread core/src/test/java/io/substrait/relation/AggregateRelTest.java Outdated
Comment thread core/src/test/java/io/substrait/relation/AggregateRelTest.java
@gord02
gord02 requested a review from vbarua October 2, 2025 14:27

@vbarua vbarua left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall looks good. Left some final suggestions, along with one improvement.

Comment thread core/src/main/java/io/substrait/relation/ProtoRelConverter.java Outdated
Comment thread core/src/main/java/io/substrait/relation/ProtoRelConverter.java Outdated
Comment thread core/src/main/java/io/substrait/relation/ProtoRelConverter.java Outdated
Comment thread core/src/test/java/io/substrait/relation/AggregateRelTest.java Outdated
Comment thread core/src/test/java/io/substrait/relation/AggregateRelTest.java Outdated
Comment thread core/src/test/java/io/substrait/relation/AggregateRelTest.java Outdated
Comment thread core/src/test/java/io/substrait/relation/AggregateRelTest.java Outdated
@gord02
gord02 requested a review from vbarua October 3, 2025 14:22

@vbarua vbarua left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks to me. Thanks for working on this!

@vbarua
vbarua merged commit 637ffbf into substrait-io:main Oct 3, 2025
11 of 12 checks passed
@benbellick

Copy link
Copy Markdown
Member

Just commenting here in case others are confused about this in the future. This PR only introduces support for the old and new format to be consumed, but only the old format is produced.

See #744 to see where we begin emitting both the old and the new field.

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.

4 participants