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

Query having same aggregate functions but different case throws IndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.13.1
    • 0.14.0
    • Query Processor
    • None

    Description

      A query having same aggregate functions (e.g. count) but in different case does not work and throws IndexOutOfBoundsException.

      Query:
      SELECT key, COUNT(value) FROM src GROUP BY key HAVING count(value) >= 4
      ---
      Error log:
      14/08/06 11:00:45 ERROR ql.Driver: FAILED: IndexOutOfBoundsException Index: 2, Size: 2
      java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
      	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
      	at java.util.ArrayList.get(ArrayList.java:322)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genGroupByPlanReduceSinkOperator(SemanticAnalyzer.java:4173)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genGroupByPlanMapAggrNoSkew(SemanticAnalyzer.java:5165)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:8337)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9178)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:9431)
      	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:207)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:414)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:310)
      	at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1023)
      	at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1088)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:960)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:950)
      	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:265)
      	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:217)
      	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:427)
      	at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:800)
      	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:694)
      	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:633)
      

      Attachments

        1. HIVE-7635.patch
          5 kB
          Chaoyu Tang
        2. HIVE-7635.1.patch
          9 kB
          Chaoyu Tang

        Activity

          People

            ctang Chaoyu Tang
            ctang Chaoyu Tang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: