[
https://issues.apache.org/jira/browse/CALCITE-6475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17866956#comment-17866956
]
Alessandro Solimando commented on CALCITE-6475:
-----------------------------------------------
Thanks [~nobigo] for the explanation, now I get the problem much better.
What about "RelToSql converter fails when the IN-list contains NULL and it is
converted to VALUES" as Jira title?
I am capitalizing VALUES although it's not a reserved keyword in standard SQL,
but it is in Calcite, you can write it as "Values" if you prefer.
WDYT?
> RelToSql converter fails when IN-list that the values include NULL is
> converted to Values
> -----------------------------------------------------------------------------------------
>
> Key: CALCITE-6475
> URL: https://issues.apache.org/jira/browse/CALCITE-6475
> Project: Calcite
> Issue Type: Bug
> Reporter: xiong duan
> Assignee: xiong duan
> Priority: Major
>
> The SQL
> {code:java}
> select * from "product" where ("product_id") in (12, null){code}
> When we convert the IN-list to OR condition, it can run successfully. But
> when we convert it to VALUES, it will throw NPE:
> {code:java}
> java.lang.NullPointerException
> at
> org.apache.calcite.rel.rel2sql.SqlImplementor.toSql(SqlImplementor.java:1468)
> at
> org.apache.calcite.rel.rel2sql.SqlImplementor.toSql(SqlImplementor.java:1416)
> at
> org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:702)
> at
> org.apache.calcite.rel.rel2sql.RelToSqlConverter.lambda$exprList$17(RelToSqlConverter.java:1158){code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)