Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-7362 Enabling Correlation Optimizer by default.
  3. HIVE-7398

Parent GBY of MUX is removed even it's not for semijoin

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.14.0
    • Query Processor
    • None

    Description

      set hive.optimize.correlation=true;
      
      explain
      select b.key, count(*) 
      from src b 
      group by b.key
      having exists 
        (select a.key 
        from src a 
        where a.key = b.key and a.value > 'val_9'
        );
      

      One of the parent of Mux is final type GBY, but it's regarded as one for semi-join and removed, throwing exception,

      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
      	at java.util.ArrayList.get(ArrayList.java:322)
      	at org.apache.hadoop.hive.ql.optimizer.GenMRRedSink2.process(GenMRRedSink2.java:58)
      	at org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:90)
      	at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatchAndReturn(DefaultGraphWalker.java:94)
      	at org.apache.hadoop.hive.ql.parse.GenMapRedWalker.walk(GenMapRedWalker.java:54)
      	at org.apache.hadoop.hive.ql.parse.GenMapRedWalker.walk(GenMapRedWalker.java:65)
      	at org.apache.hadoop.hive.ql.parse.GenMapRedWalker.walk(GenMapRedWalker.java:65)
      	at org.apache.hadoop.hive.ql.parse.GenMapRedWalker.walk(GenMapRedWalker.java:65)
      	at org.apache.hadoop.hive.ql.parse.GenMapRedWalker.walk(GenMapRedWalker.java:65)
      	at org.apache.hadoop.hive.ql.parse.GenMapRedWalker.walk(GenMapRedWalker.java:65)
      	at org.apache.hadoop.hive.ql.parse.GenMapRedWalker.walk(GenMapRedWalker.java:65)
      	at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:109)
      	at org.apache.hadoop.hive.ql.parse.MapReduceCompiler.generateTaskTree(MapReduceCompiler.java:325)
      	at org.apache.hadoop.hive.ql.parse.TaskCompiler.compile(TaskCompiler.java:199)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:9523)
      	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:328)
      	at org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyzeInternal(ExplainSemanticAnalyzer.java:74)
      	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:328)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:411)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:307)
      	at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:960)
      	at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1025)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:897)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:887)
      	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-7398.1.patch.txt
          20 kB
          Navis Ryu

        Activity

          People

            navis Navis Ryu
            navis Navis Ryu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: