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

ClassCastException in SqlToRelConverter#pushDownNotForIn

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.17.0
    • 1.18.0
    • core
    • None

    Description

      In the sql as follow:

      select empno from emp 
      where not case when true then deptno in (10,20) else true end
      

      A ClassCastException was thrown out as follow:

      java.lang.ClassCastException: org.apache.calcite.sql.fun.SqlCase cannot be cast to org.apache.calcite.sql.SqlBasicCall
      
      at org.apache.calcite.sql2rel.SqlToRelConverter.pushDownNotForIn(SqlToRelConverter.java:987)
      at org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(SqlToRelConverter.java:1070)
      at 
      

      The reason for this issue is that   the SqlToRelConverter#pushDownNotForIn method missing consideration

       for SqlCase as the code shown below:

      I have made a PR for this issue which push not down through SqlCase.Anybody can have a check for me? Thanks!

       

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              pzw2018 pengzhiwei
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: