hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jiraposter@reviews.apache.org (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-2145) NPE during parsing order-by expression
Date Mon, 12 Sep 2011 17:36:15 GMT

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

jiraposter@reviews.apache.org commented on HIVE-2145:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1802/
-----------------------------------------------------------

Review request for hive and Ning Zhang.


Summary
-------

While compiling the query if order by contains function throwing an exception..


This addresses bug HIVE-2145.
    https://issues.apache.org/jira/browse/HIVE-2145


Diffs
-----

  trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ErrorMsg.java 1167000 
  trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 1167000 
  trunk/ql/src/test/queries/clientnegative/orderby_function.q PRE-CREATION 
  trunk/ql/src/test/results/clientnegative/orderby_function.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/1802/diff


Testing
-------

Added unit test case and ran all existing test cases


Thanks,

chinna



> NPE during parsing order-by expression
> --------------------------------------
>
>                 Key: HIVE-2145
>                 URL: https://issues.apache.org/jira/browse/HIVE-2145
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ning Zhang
>            Assignee: Chinna Rao Lalam
>         Attachments: HIVE-2145.patch
>
>
> The following query throws NPE, where it should have throw parsing exception. 
> hive> select key, count(1) cnt from src group by key order by count(1) limit 10;
> select key, count(1) cnt from src group by key order by count(1) limit 10;
> FAILED: Hive Internal Error: java.lang.NullPointerException(null)
> java.lang.NullPointerException
> 	at org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc.newInstance(ExprNodeGenericFuncDesc.java:153)
> 	at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.getXpathOrFuncExprNodeDesc(TypeCheckProcFactory.java:640)
> 	at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.process(TypeCheckProcFactory.java:761)
> 	at org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:89)
> 	at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:88)
> 	at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.walk(DefaultGraphWalker.java:125)
> 	at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:102)
> 	at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory.genExprNode(TypeCheckProcFactory.java:156)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:6830)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:6788)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genReduceSinkPlan(SemanticAnalyzer.java:4303)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:5461)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:6022)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:6607)
> 	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:238)
> 	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:340)
> 	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:790)
> 	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:209)
> 	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:286)
> 	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:514)
> 	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:156)
> Correct syntax should be: 
> hive> select key, count(1) cnt from src group by key order by cnt limit 10;

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message