Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6475

RelToSql converter fails when the IN-list contains NULL and it is converted to VALUES

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.38.0
    • None

    Description

      The SQL

      select * from "product" where ("product_id") in (12, null)

      When we convert the IN-list to OR condition, it can run successfully. But when we convert it to VALUES, it will throw NPE:

      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)

      Attachments

        Issue Links

          Activity

            People

              nobigo xiong duan
              nobigo xiong duan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: