[
https://issues.apache.org/jira/browse/CALCITE-6475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17866578#comment-17866578
]
xiong duan commented on CALCITE-6475:
-------------------------------------
This SQL can run successfully both ways:
{code:java}
select * from "product" where ("product_id") in (12, cast(null as
integer)){code}
> 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
> 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)