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

SQL Queries fails with DB2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.3.0
    • None
    • Client - Java
    • None
    • Centos 7.4.1 and Mac OS-X (10.13.4) . Java 1.8 build 1.8.0_102-b14 . DB2 11.1.0

       

    Description

      Queries like SELECT 'test' FROM db2.SYSIBM.SYSDUMMY1 fails with the lates db2 driver 4.21.29 (More: https://stackoverflow.com/questions/49710342/error-when-using-db2-from-apache-drill)

      Connection:

      { "type": "jdbc", "driver": "com.ibm.db2.jcc.DB2Driver", "url": "jdbc:db2://host:50000/TESTDB", "username": "db2inst1", "password": "XXXXXXX", "enabled": true }

      Query throws following stack trace: 

      at org.apache.drill.exec.store.jdbc.JdbcStoragePlugin$JdbcCatalogSchema.setHolder(JdbcStoragePlugin.java:346) ~[drill-jdbc-storage-1.13.0.jar:1.13.0]
      at org.apache.drill.exec.store.jdbc.JdbcStoragePlugin.registerSchemas(JdbcStoragePlugin.java:434) ~[drill-jdbc-storage-1.13.0.jar:1.13.0]
      at org.apache.calcite.jdbc.DynamicRootSchema.loadSchemaFactory(DynamicRootSchema.java:81) ~[drill-java-exec-1.13.0.jar:1.15.0-drill-r0]
      at org.apache.calcite.jdbc.DynamicRootSchema.getImplicitSubSchema(DynamicRootSchema.java:66) ~[drill-java-exec-1.13.0.jar:1.15.0-drill-r0]
      at org.apache.calcite.jdbc.CalciteSchema.getSubSchema(CalciteSchema.java:233) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.sql.validate.SqlValidatorUtil.getSchema(SqlValidatorUtil.java:992) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.sql.validate.SqlValidatorUtil.getTableEntry(SqlValidatorUtil.java:953) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.prepare.CalciteCatalogReader.getTable(CalciteCatalogReader.java:117) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.drill.exec.planner.sql.SqlConverter$DrillCalciteCatalogReader.getTable(SqlConverter.java:633) ~[drill-java-exec-1.13.0.jar:1.13.0]
      at org.apache.drill.exec.planner.sql.SqlConverter$DrillValidator.validateFrom(SqlConverter.java:261) ~[drill-java-exec-1.13.0.jar:1.13.0]
      at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3216) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:947) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:928) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:226) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:903) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:613) ~[calcite-core-1.15.0-drill-r0.jar:1.15.0-drill-r0]
      at org.apache.drill.exec.planner.sql.SqlConverter.validate(SqlConverter.java:190) [drill-java-exec-1.13.0.jar:1.13.0]
      ... 10 common frames omitted
      2018-04-14 14:27:08,776 [qtp2102527385-110] ERROR o.a.d.e.server.rest.QueryResources - Query from Web UI Failed
      org.apache.drill.common.exceptions.UserRemoteException: VALIDATION ERROR: null

      SQL Query null

      [Error Id: 16121ad3-919b-44cb-b343-b71ec56314f7 on 10.21.238.244:31010]
      at org.apache.drill.exec.rpc.AbstractDisposableUserClientConnection.sendResult(AbstractDisposableUserClientConnection.java:85) ~[drill-java-exec-1.13.0.jar:1.13.0]
      at org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:782) ~[drill-java-exec-1.13.0.jar:1.13.0]
      at org.apache.drill.exec.work.foreman.QueryStateProcessor.checkCommonStates(QueryStateProcessor.java:325) ~[drill-java-exec-1.13.0.jar:1.13.0]
      at org.apache.drill.exec.work.foreman.QueryStateProcessor.planning(QueryStateProcessor.java:221) ~[drill-java-exec-1.13.0.jar:1.13.0]
      at org.apache.drill.exec.work.foreman.QueryStateProcessor.moveToState(QueryStateProcessor.java:83) ~[drill-java-exec-1.13.0.jar:1.13.0]
      at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:281) ~[drill-java-exec-1.13.0.jar:1.13.0]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_144]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_144]
      at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_144]
      2018-04-14 14:27:08,818 [252e1a73-4a10-5b33-00fa-6109db8680e2:foreman] INFO o.apache.drill.exec.work.WorkManager - Waiting for 0 queries to complete before shutting down
      2018-04-14 14:27:08,818 [252e1a73-4a10-5b33-00fa-6109db8680e2:foreman] INFO o.apache.drill.exec.work.WorkManager - Waiting for 0 running fragments to complete before shutting down

      Attachments

        Activity

          People

            Unassigned Unassigned
            jmx Juha
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: