feat(core): add typeVariationReference to UserDefined type#794
Open
kadinrabo wants to merge 1 commit intosubstrait-io:mainfrom
Open
feat(core): add typeVariationReference to UserDefined type#794kadinrabo wants to merge 1 commit intosubstrait-io:mainfrom
kadinrabo wants to merge 1 commit intosubstrait-io:mainfrom
Conversation
The Substrait proto defines type_variation_reference on UserDefined but substrait-java ignores it. Add the field to the POJO, thread it through both proto converters, and add builder/DSL overloads. Closes substrait-io#567
Contributor
Author
|
This addresses the Happy to open a follow-up PR for comprehensive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
typeVariationReferencesupport to theType.UserDefinedPOJO, closing the gap where the Substrait proto definestype_variation_reference(field #2) onUserDefinedbut substrait-java ignores it entirely.Downstream users who need type variations on UDTs (e.g., specialized execution engine variants) previously had to drop to raw proto manipulation. This change threads the field through the full POJO ↔ proto roundtrip.
Closes #567
Changes
typeVariationReference()toUserDefined(abstract + builder default, see note below)getTypeVariationReference()from proto when building POJOtypeVariationReferencethrough POJO→proto conversiontypeVariationReferenceNote on Immutables workaround
typeVariationReferenceusesabstract+ builder factory default instead of@Value.Defaultdue to an Immutables codegen bug: when a@Value.Enclosingtype has multiple@Value.Defaultfields in a nested class, the generatedInitShimreferencesUserDefined.superfrom a non-subclass context. The workaround achieves identical ergonomics — callers don't need to set the field explicitly.Test plan
roundtripCustomTypeWithVariationReferencetest: creates UDT withtypeVariationReference=42, roundtrips through proto, verifies both proto-level field value and full POJO equalityroundtripCustomTypetest: added assertion that defaulttypeVariationReferenceis 0