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

TPC-DS query16 fails - IllegalArgumentException: Target must be less than target count

    Details

    • Type: Bug
    • Status: Reviewable
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.14.0
    • Component/s: Execution - Flow
    • Labels:
    • Environment:

      4 node cluster

      Description

      TPC-DS query 16 fails with below Exception. Query 32, Query 92, query 95 also fail due to same Exception, on Drill 1.10.0 (commit ID: bbcf4b76) against SF1 data.

      Details from drillbit.log and stack trace.

      2017-01-10 11:42:54,769 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.drill.exec.work.foreman.Foreman - Query text for query id 278b3740-fa7b-0f27-5c42-92f2f63f7f3d: SELECT
      Count(DISTINCT cs_order_number) AS `order count` ,
      Sum(cs_ext_ship_cost)           AS `total shipping cost` ,
      Sum(cs_net_profit)              AS `total net profit`
      FROM     catalog_sales cs1 ,
      date_dim ,
      customer_address ,
      call_center
      WHERE    d_date BETWEEN '2002-3-01' AND      (
      Cast('2002-3-01' AS DATE) + INTERVAL '60' day)
      AND      cs1.cs_ship_date_sk = d_date_sk
      AND      cs1.cs_ship_addr_sk = ca_address_sk
      AND      ca_state = 'IA'
      AND      cs1.cs_call_center_sk = cc_call_center_sk
      AND      cc_county IN ('Williamson County',
      'Williamson County',
      'Williamson County',
      'Williamson County',
      'Williamson County' )
      AND      EXISTS
      (
      SELECT *
      FROM   catalog_sales cs2
      WHERE  cs1.cs_order_number = cs2.cs_order_number
      AND    cs1.cs_warehouse_sk <> cs2.cs_warehouse_sk)
      AND      NOT EXISTS
      (
      SELECT *
      FROM   catalog_returns cr1
      WHERE  cs1.cs_order_number = cr1.cr_order_number)
      ORDER BY count(DISTINCT cs_order_number)
      LIMIT 100
      2017-01-10 11:42:54,887 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,888 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,895 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,895 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,902 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,903 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,908 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,909 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,919 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,920 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, numFiles: 1
      2017-01-10 11:42:54,946 [278b3740-fa7b-0f27-5c42-92f2f63f7f3d:foreman] ERROR o.a.drill.exec.work.foreman.Foreman - SYSTEM ERROR: IllegalArgumentException: Target must be less than target count, 3
      
      
      [Error Id: 61befda9-3479-48a4-a6ff-181703aea1b7 on centos-01.qa.lab:31010]
      org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: IllegalArgumentException: Target must be less than target count, 3
      
      
      [Error Id: 61befda9-3479-48a4-a6ff-181703aea1b7 on centos-01.qa.lab:31010]
              at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:544) ~[drill-common-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:824) [drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.work.foreman.Foreman.moveToState(Foreman.java:944) [drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:281) [drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
      Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception during fragment initialization: Target must be less than target count, 3
              ... 4 common frames omitted
      Caused by: java.lang.IllegalArgumentException: Target must be less than target count, 3
              at org.apache.calcite.util.mapping.Mappings$PartialFunctionImpl.set(Mappings.java:1642) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
              at org.apache.calcite.util.mapping.Mappings.target(Mappings.java:343) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
              at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:411) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
              at sun.reflect.GeneratedMethodAccessor237.invoke(Unknown Source) ~[na:na]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
              at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
              at org.apache.calcite.util.ReflectUtil.invokeVisitorInternal(ReflectUtil.java:257) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
              at org.apache.calcite.util.ReflectUtil.invokeVisitor(ReflectUtil.java:214) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
              at org.apache.calcite.util.ReflectUtil$1.invokeVisitor(ReflectUtil.java:471) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
              at org.apache.calcite.sql2rel.RelDecorrelator$DecorrelateRelVisitor.visit(RelDecorrelator.java:1433) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
              at org.apache.calcite.sql2rel.RelDecorrelator.decorrelate(RelDecorrelator.java:238) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
              at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateQuery(RelDecorrelator.java:205) ~[calcite-core-1.4.0-drill-r19.jar:1.4.0-drill-r19]
              at org.apache.drill.exec.planner.sql.SqlConverter.toRel(SqlConverter.java:265) ~[drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToRel(DefaultSqlHandler.java:626) ~[drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert(DefaultSqlHandler.java:195) ~[drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:164) ~[drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPhysicalPlan(DrillSqlWorker.java:122) ~[drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:96) ~[drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:1017) [drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:264) [drill-java-exec-1.10.0-SNAPSHOT.jar:1.10.0-SNAPSHOT]
              ... 3 common frames omitted
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vvysotskyi Volodymyr Vysotskyi
                Reporter:
                khfaraaz Khurram Faraaz
                Reviewer:
                Aman Sinha
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: