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

ClassCastException in SqlToRelConverter#pushDownNotForIn

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.17.0
    • Fix Version/s: 1.18.0
    • Component/s: core
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: