[ 
https://issues.apache.org/jira/browse/HIVE-8549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14179634#comment-14179634
 ] 

Gunther Hagleitner commented on HIVE-8549:
------------------------------------------

+1 - test case would be nice though.

> NPE in PK-FK inference when one side of join is complex tree
> ------------------------------------------------------------
>
>                 Key: HIVE-8549
>                 URL: https://issues.apache.org/jira/browse/HIVE-8549
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Query Processor, Statistics
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Prasanth J
>            Assignee: Prasanth J
>            Priority: Critical
>         Attachments: HIVE-8549.1.patch, HIVE-8549.2.patch
>
>
> HIVE-8168 added PK-FK inference from column stats. But when one side of join 
> is complex tree which propagates FK, relationship inference fails with NPE.
> {code}
> java.lang.NullPointerException
>         at 
> org.apache.hadoop.hive.ql.optimizer.stats.annotation.StatsRulesProcFactory$JoinStatsRule.getSelectivity(StatsRulesProcFactory.java:1293)
>         at 
> org.apache.hadoop.hive.ql.optimizer.stats.annotation.StatsRulesProcFactory$JoinStatsRule.inferPKFKRelationship(StatsRulesProcFactory.java:1250)
>         at 
> org.apache.hadoop.hive.ql.optimizer.stats.annotation.StatsRulesProcFactory$JoinStatsRule.process(StatsRulesProcFactory.java:1067)
>         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.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:78)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:54)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:59)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:59)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:59)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:59)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:59)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:59)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:59)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:59)
>         at 
> org.apache.hadoop.hive.ql.lib.PreOrderWalker.walk(PreOrderWalker.java:59)
>         at 
> org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:109)
>         at 
> org.apache.hadoop.hive.ql.optimizer.stats.annotation.AnnotateWithStatistics.transform(AnnotateWithStatistics.java:78)
>         at 
> org.apache.hadoop.hive.ql.parse.TezCompiler.runStatsAnnotation(TezCompiler.java:248)
>         at 
> org.apache.hadoop.hive.ql.parse.TezCompiler.optimizeOperatorPlan(TezCompiler.java:120)
>         at 
> org.apache.hadoop.hive.ql.parse.TaskCompiler.compile(TaskCompiler.java:99)
>         at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10039)
>         at 
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:221)
>         at 
> org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyzeInternal(ExplainSemanticAnalyzer.java:74)
>         at 
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:221)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:415)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:303)
>         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1067)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1129)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1004)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:994)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:247)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:199)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:410)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:783)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to