[Coral-Trino] Fix translation of IN predicate inside JOIN clause - #614
Open
findinpath wants to merge 1 commit into
Open
[Coral-Trino] Fix translation of IN predicate inside JOIN clause#614findinpath wants to merge 1 commit into
findinpath wants to merge 1 commit into
Conversation
findinpath
force-pushed
the
findinpath/join-with-in-condition
branch
2 times, most recently
from
August 10, 2026 15:13
d952756 to
4b35994
Compare
findinpath
force-pushed
the
findinpath/join-with-in-condition
branch
from
August 10, 2026 15:14
4b35994 to
1271c94
Compare
wmoustafa
reviewed
Aug 13, 2026
wmoustafa
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR. An alternate approach is to modify LinkedIn's Calcite fork to support OTHER operator kinds, but we can go with this approach since it is somewhat specific to Coral IN operator.
Contributor
|
Can we also apply the same change to |
Calcite's SqlImplementor.convertConditionToSqlNode only handles equality/comparison/null operators in join conditions. CoralINOperator uses SqlKind.OTHER (not SqlKind.IN), so it fell through to the default case and threw AssertionError. Override convertConditionToSqlNode in RelToTrinoConverter and CoralRelToSqlNodeConverter to intercept CoralINOperator nodes and delegate to a join-scoped Context.toSql call, which correctly resolves column references from both sides of the join and renders the IN list via CoralINOperator.unparse.
findinpath
force-pushed
the
findinpath/join-with-in-condition
branch
from
August 13, 2026 13:37
1271c94 to
fdedba7
Compare
wmoustafa
approved these changes
Aug 13, 2026
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.
Reproduction of the issue
Stacktrace when querying through Trino
Full stacktrace
What changes are proposed in this pull request, and why are they necessary?
Calcite's
SqlImplementor.convertConditionToSqlNodeonly handles equality/comparison/null operators in join conditions.CoralINOperatorusesSqlKind.OTHER(notSqlKind.IN), so it fell through to the default case and threw AssertionError.Override
convertConditionToSqlNodeinRelToTrinoConverterto interceptCoralINOperatornodes and delegate to a join-scoped Context.toSql call, which correctly resolves column references from both sides of the join and renders theINlist viaCoralINOperator.unparse.How was this patch tested?
The patch has been tested with unit tests in
HiveToTrinoConverterTest.