Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-11737

IndexOutOfBounds compiling query with duplicated groupby keys

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 2.0.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      SELECT
      tinyint_col_7,
      MIN(timestamp_col_1) AS timestamp_col,
      MAX(LEAST(CAST(COALESCE(int_col_5, -279) AS int), CAST(COALESCE(tinyint_col_7, 476) AS int))) AS int_col,
      tinyint_col_7 AS int_col_1,
      LEAST(CAST(COALESCE(int_col_5, -279) AS int), CAST(COALESCE(tinyint_col_7, 476) AS int)) AS int_col_2
      FROM table_3
      GROUP BY
      tinyint_col_7,
      tinyint_col_7,
      LEAST(CAST(COALESCE(int_col_5, -279) AS int), CAST(COALESCE(tinyint_col_7, 476) AS int))
      

      Query compilation fails:

      Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
      	at java.util.ArrayList.rangeCheck(ArrayList.java:635)
      	at java.util.ArrayList.get(ArrayList.java:411)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genGroupByPlanReduceSinkOperator(SemanticAnalyzer.java:4633)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genGroupByPlanMapAggrNoSkew(SemanticAnalyzer.java:5630)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:8987)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9864)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9757)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genOPTree(SemanticAnalyzer.java:10193)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10204)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10121)
      	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:222)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:421)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:305)
      	at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1110)
      	at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1104)
      

        Attachments

        1. HIVE-11737.3.patch
          5 kB
          Jimmy Xiang
        2. HIVE-11737.2.patch
          6 kB
          Jimmy Xiang
        3. HIVE-11737.1.patch
          0.6 kB
          Jimmy Xiang

          Activity

            People

            • Assignee:
              jxiang Jimmy Xiang
              Reporter:
              jxiang Jimmy Xiang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: