[
https://issues.apache.org/jira/browse/CALCITE-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16768637#comment-16768637
]
Jesus Camacho Rodriguez commented on CALCITE-2842:
--------------------------------------------------
[~julianhyde], thanks for the feedback. {{SIMPLE_BINARY_OPS}} seems to be used
only to compute digest for RexCall. IN clause seems to be slightly different
than other ops in the group, since second parameter would be a row/struct, even
in SQL node realm? I am just wondering if it would be OK to push this change,
since 1) it will not affect any other Calcite logic as it does not use
SqlKind.IN in RexCall nodes, and 2) it will help us triggering some rewritings
that do in Hive to expand those IN clauses via rules.
> Computing digest of IN expressions leads to Exceptions
> ------------------------------------------------------
>
> Key: CALCITE-2842
> URL: https://issues.apache.org/jira/browse/CALCITE-2842
> Project: Calcite
> Issue Type: Bug
> Reporter: Zoltan Haindrich
> Assignee: Julian Hyde
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Testcase:
> {code}
> /* RexProgramTest */
> @Test public void testInDigest() {
> RexNode e = in(vInt(), literal(1), literal(2));
> assertThat(e.toString(), is("IN(?0.int0, 1, 2)"));
> }
> /* RexProgramBuilder */
> protected RexNode in(Iterable<? extends RexNode> nodes) {
> return rexBuilder.makeCall(SqlStdOperatorTable.IN,
> ImmutableList.copyOf(nodes));
> }
> {code}
> The exception is due to that it tries to look at the other operand
> https://github.com/apache/calcite/blob/883666929478aabe07ee5b9e572c43a6f1a703e2/core/src/main/java/org/apache/calcite/rex/RexCall.java#L115
> [SIMPLE_BINARY_OPS|https://github.com/apache/calcite/blob/883666929478aabe07ee5b9e572c43a6f1a703e2/core/src/main/java/org/apache/calcite/rex/RexCall.java#L64]
> contains
> [COMPARISION|https://github.com/apache/calcite/blob/883666929478aabe07ee5b9e572c43a6f1a703e2/core/src/main/java/org/apache/calcite/sql/SqlKind.java#L1248]
> which also contains "IN"
> this was introduced in CALCITE-2454 a few days ago; bug not released
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)