Hive
  1. Hive
  2. HIVE-2839

Filters on outer join with mapjoin hint is not applied correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: Query Processor
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Testing HIVE-2820, I've found some queries with mapjoin hint makes exceptions.

      SELECT /*+ MAPJOIN(a) */ * FROM src a RIGHT OUTER JOIN src b on a.key=b.key AND true limit 10;
      
      FAILED: Hive Internal Error: java.lang.ClassCastException(org.apache.hadoop.hive.ql.plan.ExprNodeConstantDesc cannot be cast to org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc)
      java.lang.ClassCastException: org.apache.hadoop.hive.ql.plan.ExprNodeConstantDesc cannot be cast to org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc
      	at org.apache.hadoop.hive.ql.optimizer.MapJoinProcessor.convertMapJoin(MapJoinProcessor.java:363)
      	at org.apache.hadoop.hive.ql.optimizer.MapJoinProcessor.generateMapJoinOperator(MapJoinProcessor.java:483)
      	at org.apache.hadoop.hive.ql.optimizer.MapJoinProcessor.transform(MapJoinProcessor.java:689)
      	at org.apache.hadoop.hive.ql.optimizer.Optimizer.optimize(Optimizer.java:87)
      	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:7519)
      	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:250)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:431)
      	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:336)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:891)
      	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:255)
      	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:212)
      	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
      	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:671)
      	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:554)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
      

      and

      SELECT /*+ MAPJOIN(a) */ * FROM src a RIGHT OUTER JOIN src b on a.key=b.key AND b.key * 10 < '1000' limit 10;
      
      java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException
      	at org.apache.hadoop.hive.ql.exec.ExecMapper.map(ExecMapper.java:161)
      	at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
      	at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:391)
      	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:325)
      	at org.apache.hadoop.mapred.Child$4.run(Child.java:270)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:416)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1127)
      	at org.apache.hadoop.mapred.Child.main(Child.java:264)
      Caused by: org.apache.hadoop.hive.ql.metadata.HiveException
      	at org.apache.hadoop.hive.ql.exec.MapJoinOperator.loadHashTable(MapJoinOperator.java:198)
      	at org.apache.hadoop.hive.ql.exec.MapJoinOperator.cleanUpInputFileChangedOp(MapJoinOperator.java:212)
      	at org.apache.hadoop.hive.ql.exec.Operator.cleanUpInputFileChanged(Operator.java:1321)
      	at org.apache.hadoop.hive.ql.exec.Operator.cleanUpInputFileChanged(Operator.java:1325)
      	at org.apache.hadoop.hive.ql.exec.Operator.cleanUpInputFileChanged(Operator.java:1325)
      	at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:495)
      	at org.apache.hadoop.hive.ql.exec.ExecMapper.map(ExecMapper.java:143)
      	... 8 more
      
      1. HIVE-2839.D2079.7.patch
        37 kB
        Phabricator
      2. HIVE-2839.D2079.6.patch
        37 kB
        Phabricator
      3. HIVE-2839.D2079.5.patch
        11 kB
        Phabricator
      4. HIVE-2839.D2079.4.patch
        11 kB
        Phabricator
      5. HIVE-2839.D2079.3.patch
        9 kB
        Phabricator
      6. ASF.LICENSE.NOT.GRANTED--HIVE-2839.D2079.2.patch
        9 kB
        Phabricator
      7. ASF.LICENSE.NOT.GRANTED--HIVE-2839.D2079.1.patch
        9 kB
        Phabricator

        Issue Links

          Activity

            People

            • Assignee:
              Navis
              Reporter:
              Navis
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development