Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7072

Query with semi join fails for JDBC storage plugin

    XMLWordPrintableJSON

Details

    Description

      When running a query with semi join for JDBC storage plugin, it fails with class cast exception:

      select person_id from mysql.`drill_mysql_test`.person t1
      where exists (
      select person_id from mysql.`drill_mysql_test`.person
      where t1.person_id = person_id)
      
      SYSTEM ERROR: ClassCastException: org.apache.calcite.adapter.jdbc.JdbcRules$JdbcAggregate cannot be cast to org.apache.drill.exec.planner.logical.DrillAggregateRel
      
      
      Please, refer to logs for more information.
      
      [Error Id: 85a27762-a4e5-4571-909f-0efa18ca0689 on user515050-pc:31013]
      org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: ClassCastException: org.apache.calcite.adapter.jdbc.JdbcRules$JdbcAggregate cannot be cast to org.apache.drill.exec.planner.logical.DrillAggregateRel
      
      
      Please, refer to logs for more information.
      
      [Error Id: 85a27762-a4e5-4571-909f-0efa18ca0689 on user515050-pc:31013]
      	at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:633) ~[classes/:na]
      	at org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:779) [classes/:na]
      	at org.apache.drill.exec.work.foreman.QueryStateProcessor.checkCommonStates(QueryStateProcessor.java:325) [classes/:na]
      	at org.apache.drill.exec.work.foreman.QueryStateProcessor.planning(QueryStateProcessor.java:221) [classes/:na]
      	at org.apache.drill.exec.work.foreman.QueryStateProcessor.moveToState(QueryStateProcessor.java:83) [classes/:na]
      	at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:299) [classes/:na]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191]
      	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]
      Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception during fragment initialization: org.apache.calcite.adapter.jdbc.JdbcRules$JdbcAggregate cannot be cast to org.apache.drill.exec.planner.logical.DrillAggregateRel
      	at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:300) [classes/:na]
      	... 3 common frames omitted
      Caused by: java.lang.ClassCastException: org.apache.calcite.adapter.jdbc.JdbcRules$JdbcAggregate cannot be cast to org.apache.drill.exec.planner.logical.DrillAggregateRel
      	at org.apache.drill.exec.planner.logical.DrillSemiJoinRule.matches(DrillSemiJoinRule.java:171) ~[classes/:na]
      	at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:557) ~[calcite-core-1.18.0-drill-r0.jar:1.18.0-drill-r0]
      	at org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:420) ~[calcite-core-1.18.0-drill-r0.jar:1.18.0-drill-r0]
      	at org.apache.calcite.plan.hep.HepPlanner.executeInstruction(HepPlanner.java:257) ~[calcite-core-1.18.0-drill-r0.jar:1.18.0-drill-r0]
      	at org.apache.calcite.plan.hep.HepInstruction$RuleInstance.execute(HepInstruction.java:127) ~[calcite-core-1.18.0-drill-r0.jar:1.18.0-drill-r0]
      	at org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:216) ~[calcite-core-1.18.0-drill-r0.jar:1.18.0-drill-r0]
      	at org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.java:203) ~[calcite-core-1.18.0-drill-r0.jar:1.18.0-drill-r0]
      	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.transform(DefaultSqlHandler.java:431) ~[classes/:na]
      	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.transform(DefaultSqlHandler.java:382) ~[classes/:na]
      	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.transform(DefaultSqlHandler.java:365) ~[classes/:na]
      	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToRawDrel(DefaultSqlHandler.java:289) ~[classes/:na]
      	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:331) ~[classes/:na]
      	at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:178) ~[classes/:na]
      	at org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan(DrillSqlWorker.java:204) ~[classes/:na]
      	at org.apache.drill.exec.planner.sql.DrillSqlWorker.convertPlan(DrillSqlWorker.java:123) ~[classes/:na]
      	at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:80) ~[classes/:na]
      	at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:584) [classes/:na]
      	at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:272) [classes/:na]
      	... 3 common frames omitted
      

      Looks like it was caused by DRILL-6997.

      Attachments

        Issue Links

          Activity

            People

              volodymyr Vova Vysotskyi
              volodymyr Vova Vysotskyi
              Vitalii Diravka Vitalii Diravka
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: