Skip to content

feat(isthmus): support Substrait struct literal conversions#677

Merged
vbarua merged 14 commits intomainfrom
benbellick/udt-struct-literal-support
Feb 27, 2026
Merged

feat(isthmus): support Substrait struct literal conversions#677
vbarua merged 14 commits intomainfrom
benbellick/udt-struct-literal-support

Conversation

@benbellick
Copy link
Member

@benbellick benbellick commented Jan 15, 2026

Enables the conversion of Substrait:

  • Expression.StructLiteral
  • Expression.UserDefinedStructLiteral

to Calcite and back

Closes #612

@benbellick benbellick force-pushed the benbellick/udt-struct-literal-support branch from dfc898c to 569b512 Compare January 15, 2026 22:14
Adds test coverage for struct-encoded UDT literals that contain
list and map typed fields to ensure proper roundtrip conversion.
@benbellick benbellick marked this pull request as ready for review January 16, 2026 21:09
@benbellick
Copy link
Member Author

I'll be honest and say that I used a lot of agentic coding to figure this one out due to my lack of familiarity with Calcite. Hoping a Calcite expert (e.g. @asolimando) could help offer a review :)

@benbellick benbellick requested a review from vbarua January 16, 2026 21:10
Copy link
Contributor

@asolimando asolimando left a comment

Choose a reason for hiding this comment

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

LGTM, I guess the important points to clarify are:

  • we now throw instead of returning null, is this expected?
  • are we guaranteed against "notNull" types showing up with null literals?

In addition, a couple of minor nits, but this looks already good from my perspective.

Feel free to ping me again if you need a second round of review from me!

@benbellick benbellick force-pushed the benbellick/udt-struct-literal-support branch from b6db474 to ee8c121 Compare January 21, 2026 21:33
Copy link
Contributor

@asolimando asolimando left a comment

Choose a reason for hiding this comment

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

LGTM!

benbellick and others added 6 commits January 23, 2026 17:06
Resolve conflicts in SubstraitRelNodeConverter and SubstraitToCalcite
by adopting main's ConverterProvider-based approach.

Additional changes:
- Update UserDefinedLiteralRoundtripTest to use ConverterProvider API
- Fix missing CallConverters.ROW in ConverterProvider.getCallConverters()
Copy link
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for working on this.

*
* <p>This method is implemented by all concrete Literal classes via Immutables code generation.
*/
Literal withNullable(boolean nullable);
Copy link
Member

Choose a reason for hiding this comment

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

Oooh, that's handy.

I think we can use this to replace the

private static final class NullableSettingTypeVisitor
which uses a whole visitor just to change the nullability 😅

Would be worth quick follow-up after this PR.

@vbarua vbarua changed the title feat(isthmus): add struct-based user-defined type literal support feat(isthmus): support Substrait struct literal conversions Feb 26, 2026
@vbarua vbarua merged commit cd2535b into main Feb 27, 2026
13 checks passed
@vbarua vbarua deleted the benbellick/udt-struct-literal-support branch February 27, 2026 00:43
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.

Handle struct-based UDT literals in isthmus

3 participants