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

IOB Exception when using constants in window functions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.1.0
    • Component/s: Execution - Flow
    • Labels:
    • Environment:

      faec150598840c40827e6493992d81209aa936da

      Description

      The following query should run, but it throws an IndexOutOfBoundsException instead:

      0: jdbc:drill:schema=dfs.tmp> select count(1) over(partition by columns[1] order by columns[0]) from `time_data.csv`;
      Error: SYSTEM ERROR: java.lang.IndexOutOfBoundsException: index (2) must be less than size (2)
      
      
      [Error Id: ddcd3316-e906-4193-8e55-e208c3cda32d on centos-03.qa.lab:31010] (state=,code=0)
      

      Stack trace from drillbit.log

      org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception during fragment initialization: index (2) must be less than size (2)
              at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:251) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
              at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
      Caused by: java.lang.IndexOutOfBoundsException: index (2) must be less than size (2)
              at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:305) ~[guava-14.0.1.jar:na]
              at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:284) ~[guava-14.0.1.jar:na]
              at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:81) ~[guava-14.0.1.jar:na]
              at org.apache.calcite.util.Pair$6.get(Pair.java:335) ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
              at org.apache.drill.exec.planner.physical.WindowPrel.toDrill(WindowPrel.java:112) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.physical.WindowPrel.getPhysicalOperator(WindowPrel.java:89) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.physical.ProjectPrel.getPhysicalOperator(ProjectPrel.java:55) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.physical.ProjectPrel.getPhysicalOperator(ProjectPrel.java:55) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.physical.ScreenPrel.getPhysicalOperator(ScreenPrel.java:51) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPop(DefaultSqlHandler.java:447) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:192) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:177) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:902) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:240) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              ... 3 common frames omitted
      2015-05-30 01:22:07,372 [2a96ef40-25ae-aedc-9f56-2da309e4d911:foreman] INFO  o.a.drill.exec.work.foreman.Foreman - foreman cleaning up.
      2015-05-30 01:22:07,373 [2a96ef40-25ae-aedc-9f56-2da309e4d911:foreman] ERROR o.a.d.c.exceptions.UserException - SYSTEM ERROR: java.lang.IndexOutOfBoundsException: index (2) must be less than size (2)
      
      
      [Error Id: ddcd3316-e906-4193-8e55-e208c3cda32d on centos-03.qa.lab:31010]
      org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: java.lang.IndexOutOfBoundsException: index (2) must be less than size (2)
      
      
      [Error Id: ddcd3316-e906-4193-8e55-e208c3cda32d on centos-03.qa.lab:31010]
              at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:522) ~[drill-common-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:736) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:838) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:780) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.common.EventProcessor.sendEvent(EventProcessor.java:73) [drill-common-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman$StateSwitch.moveToState(Foreman.java:782) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman.moveToState(Foreman.java:891) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:251) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
              at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
      Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception during fragment initialization: index (2) must be less than size (2)
              ... 4 common frames omitted
      Caused by: java.lang.IndexOutOfBoundsException: index (2) must be less than size (2)
              at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:305) ~[guava-14.0.1.jar:na]
              at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:284) ~[guava-14.0.1.jar:na]
              at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:81) ~[guava-14.0.1.jar:na]
              at org.apache.calcite.util.Pair$6.get(Pair.java:335) ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
              at org.apache.drill.exec.planner.physical.WindowPrel.toDrill(WindowPrel.java:112) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.physical.WindowPrel.getPhysicalOperator(WindowPrel.java:89) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.physical.ProjectPrel.getPhysicalOperator(ProjectPrel.java:55) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.physical.ProjectPrel.getPhysicalOperator(ProjectPrel.java:55) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.physical.ScreenPrel.getPhysicalOperator(ScreenPrel.java:51) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPop(DefaultSqlHandler.java:447) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:192) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:177) ~[drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:902) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:240) [drill-java-exec-1.0.0-mapr-r1-rebuffed.jar:1.0.0-mapr-r1]
              ... 3 common frames omitted
      

        Attachments

        1. DRILL-3220.1.patch.txt
          9 kB
          Deneche A. Hakim
        2. DRILL-3220.2.patch.txt
          9 kB
          Deneche A. Hakim
        3. DRILL-3220.3.patch.txt
          9 kB
          Deneche A. Hakim

          Activity

            People

            • Assignee:
              adeneche Deneche A. Hakim
              Reporter:
              khfaraaz Khurram Faraaz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: