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

ClassCastException in RelOptUtil.containsNullableFields, attempting to convert executor to RexExecutorImpl

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.11.0
    • Fix Version/s: 1.12.0
    • Component/s: core
    • Labels:
      None
    • Environment:

      Centos7

      Description

      Since 1.11.0. In 1.9.0 everything works fine

      Stacktrace
      java.lang.ClassCastException: org.apache.flink.table.codegen.ExpressionReducer cannot be cast to org.apache.calcite.rex.RexExecutorImpl
      
      	at org.apache.calcite.plan.RelOptUtil.containsNullableFields(RelOptUtil.java:3327)
      	at org.apache.calcite.plan.RelOptUtil.createExistsPlan(RelOptUtil.java:499)
      	at org.apache.calcite.sql2rel.SqlToRelConverter.convertExists(SqlToRelConverter.java:1493)
      	at org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery(SqlToRelConverter.java:1082)
      	at org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries(SqlToRelConverter.java:990)
      	at org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(SqlToRelConverter.java:959)
      	at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:645)
      	at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:623)
      	at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:2860)
      	at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:559)
      
      Works fine
      SELECT a, c FROM T WHERE b IN (SELECT b FROM T WHERE b = 6 OR b = 1)
      
      java.lang.ClassCastException
      SELECT a, c FROM T WHERE b NOT IN (SELECT b FROM T WHERE b = 6 OR b = 1)"
      

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.12.0 (2017-03-24).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.12.0 (2017-03-24).
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/46672b41 .
        Hide
        julianhyde Julian Hyde added a comment -

        Dmytro Shkvyra, Note that interface RelOptPlanner.Executor still exists. It extends the new interface RexExecutor, so if your class implements Executor if will now also implement RexExecutor, with no code changes or re-compile. interface RelOptPlanner.Executor is deprecated, but you can continue to use it until calcite-2.0, or upgrade to RexExecutor when convenient.

        We have tried to be consistent with the principles of semantic versioning. If we have broken binary compatibility and there is something we can do to fix it, let us know. And I think the fix I have already made is an improvement, at least.

        Show
        julianhyde Julian Hyde added a comment - Dmytro Shkvyra , Note that interface RelOptPlanner.Executor still exists. It extends the new interface RexExecutor , so if your class implements Executor if will now also implement RexExecutor , with no code changes or re-compile. interface RelOptPlanner.Executor is deprecated, but you can continue to use it until calcite-2.0, or upgrade to RexExecutor when convenient. We have tried to be consistent with the principles of semantic versioning. If we have broken binary compatibility and there is something we can do to fix it, let us know. And I think the fix I have already made is an improvement, at least.
        Hide
        dshkvyra Dmytro Shkvyra added a comment -

        Julian Hyde I have seen into changes and I think it would help but it need Flink code modification because now we extends RelOptPlanner.Executor.
        I will try when I would have release 1.12.0

        Show
        dshkvyra Dmytro Shkvyra added a comment - Julian Hyde I have seen into changes and I think it would help but it need Flink code modification because now we extends RelOptPlanner.Executor. I will try when I would have release 1.12.0
        Hide
        julianhyde Julian Hyde added a comment -

        Dmytro Shkvyra, I have made a fix on https://github.com/julianhyde/calcite/tree/1691-executor. Can you let me know whether it fixes the problem? If so I will include fix in 1.12.

        Show
        julianhyde Julian Hyde added a comment - Dmytro Shkvyra , I have made a fix on https://github.com/julianhyde/calcite/tree/1691-executor . Can you let me know whether it fixes the problem? If so I will include fix in 1.12.
        Hide
        julianhyde Julian Hyde added a comment -

        Re-opening. I believe this is valid. You are not obliged to provide an executor, and if you do, it does not need to extend RexExecutorImpl. The method should fail safe (return true) in that case.

        Show
        julianhyde Julian Hyde added a comment - Re-opening. I believe this is valid. You are not obliged to provide an executor, and if you do, it does not need to extend RexExecutorImpl. The method should fail safe (return true) in that case.

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            dshkvyra Dmytro Shkvyra
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development