Apache Drill
  1. Apache Drill
  2. DRILL-440

Apparent Optiq error when trying to convert sqlnodes to rel nodes as part of coorelated subquery

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Component/s: None
    • Labels:
      None

      Description

      Example can be seen with TPCH 17:

      Exception in thread "WorkManager-1" java.lang.AssertionError: Internal error: while converting `l2`.`l_partkey` = `p`.`p_partkey`
      at org.eigenbase.util.Util.newInternal(Util.java:768)
      at org.eigenbase.sql2rel.ReflectiveConvertletTable$1.convertCall(ReflectiveConvertletTable.java:96)
      at org.eigenbase.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:52)
      at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4176)
      at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:3574)
      at org.eigenbase.sql.SqlCall.accept(SqlCall.java:166)
      at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4082)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertWhere(SqlToRelConverter.java:845)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:493)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:470)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:2758)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertQueryOrInList(SqlToRelConverter.java:1278)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertExists(SqlToRelConverter.java:1251)
      at org.eigenbase.sql2rel.SqlToRelConverter.substituteSubquery(SqlToRelConverter.java:1017)
      at org.eigenbase.sql2rel.SqlToRelConverter.replaceSubqueries(SqlToRelConverter.java:873)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertWhere(SqlToRelConverter.java:844)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:493)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:470)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:2758)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:428)
      at net.hydromatic.optiq.prepare.PlannerImpl.convert(PlannerImpl.java:169)
      at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:74)
      at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:350)
      at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:175)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.eigenbase.sql2rel.ReflectiveConvertletTable$1.convertCall(ReflectiveConvertletTable.java:87)
      ... 25 more
      Caused by: java.lang.AssertionError
      at org.eigenbase.rex.RexFieldAccess.<init>(RexFieldAccess.java:63)
      at org.eigenbase.rex.RexBuilder.makeFieldAccessInternal(RexBuilder.java:185)
      at org.eigenbase.rex.RexBuilder.makeFieldAccess(RexBuilder.java:158)
      at org.eigenbase.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:3157)
      at org.eigenbase.sql2rel.SqlToRelConverter.access$1400(SqlToRelConverter.java:59)
      at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4186)
      at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:3574)
      at org.eigenbase.sql.SqlIdentifier.accept(SqlIdentifier.java:222)
      at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4082)
      at org.eigenbase.sql2rel.StandardConvertletTable.convertExpressionList(StandardConvertletTable.java:689)
      at org.eigenbase.sql2rel.StandardConvertletTable.convertCall(StandardConvertletTable.java:642)
      ... 30 more

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Jacques Nadeau
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development