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

Jason Dere commented on HIVE-22709:
-----------------------------------

I think I see what happened - when the method signature of 
SemanticAnalyzer.analyzeInternal was changed from 
{code}
  void analyzeInternal(ASTNode ast, Supplier<PlannerContext> pcf) throws 
SemanticException {
{code}
to
{code}
 void analyzeInternal(ASTNode astToAnalyze, Supplier<PlannerContext> pcf) 
throws SemanticException {
{code}

then in this line:
{code}
lookupInfo = createLookupInfoForQuery(ast);
{code}
"ast" changed from being a method parameter to the SemanticAnalyzer.ast field. 
We just need to change that line to lookupInfo = 
createLookupInfoForQuery(astToAnalyze);
In fact all references to "ast" in that method will need to be changed to 
astToAnalyze since the parameter was renamed, it is unfortunate that 
SemanticAnalyzer had an ast field which hid this error.

> NullPointerException during query compilation after HIVE-22578
> --------------------------------------------------------------
>
>                 Key: HIVE-22709
>                 URL: https://issues.apache.org/jira/browse/HIVE-22709
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Jason Dere
>            Priority: Major
>         Attachments: results_cache_with_auth.q
>
>
> Getting a NPE during query compilation, when query results cache and Ranger 
> auth is enabled. This seems to have been caused by HIVE-22578.
> {noformat}
>  java.lang.NullPointerException
>       at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getQueryStringFromAst(SemanticAnalyzer.java:14987)
>       at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getQueryStringForCache(SemanticAnalyzer.java:15036)
>       at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.createLookupInfoForQuery(SemanticAnalyzer.java:15077)
>       at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:12513)
>       at 
> org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:358)
>       at 
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:283)
>       at 
> org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyzeInternal(ExplainSemanticAnalyzer.java:171)
>       at 
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:283)
>       at org.apache.hadoop.hive.ql.Compiler.analyze(Compiler.java:219)
>       at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:103)
>       at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:215)
>       at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:828)
>       at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:774)
>       at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:768)
>       at 
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:125)
>       at 
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:229)
>       at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:249)
>       at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:193)
>       at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:415)
>       at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:346)
>       at 
> org.apache.hadoop.hive.ql.QTestUtil.executeClientInternal(QTestUtil.java:708)
>       at org.apache.hadoop.hive.ql.QTestUtil.executeClient(QTestUtil.java:678)
>       at 
> org.apache.hadoop.hive.cli.control.CoreCliDriver.runTest(CoreCliDriver.java:169)
>       at 
> org.apache.hadoop.hive.cli.control.CliAdapter.runTest(CliAdapter.java:157)
>       at 
> org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver(TestCliDriver.java:59)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to