hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harish Butani (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-4110) Aggregation functions must have aliases when multiple functions are used
Date Sat, 02 Mar 2013 22:43:13 GMT

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

Harish Butani commented on HIVE-4110:
-------------------------------------

this is going to get fixed with 4081. 
We don't need to set the alias based on the AST tree. 
Just using the internalNames _wcol1, _wcol2,... 
The internal names are used as fields in OI, so this is the safest way to set the aliases.

Will post a patch tonight or latest by tomorrow.
Let me post the patch also, and then let's discuss. Sorry if this is duplicate effort.
                
> Aggregation functions must have aliases when multiple functions are used
> ------------------------------------------------------------------------
>
>                 Key: HIVE-4110
>                 URL: https://issues.apache.org/jira/browse/HIVE-4110
>             Project: Hive
>          Issue Type: Bug
>          Components: PTF-Windowing
>            Reporter: Brock Noland
>            Assignee: Brock Noland
>         Attachments: HIVE-4110-0.patch
>
>
> The following query fails:
> {noformat}
> select p_mfgr, p_retailprice, p_size,
> lead(p_retailprice) over(partition by p_mfgr order by p_size),
> lag(p_retailprice) over(partition by p_mfgr order by p_size)
> from part;
> {noformat}
> with the error below:
> {noformat}
> 2013-03-02 16:10:47,126 ERROR ql.Driver (SessionState.java:printError(401)) - FAILED:
SemanticException [Error 10011]: Line 2:38 Invalid function 'p_mfgr'
> org.apache.hadoop.hive.ql.parse.SemanticException: Line 2:38 Invalid function 'p_mfgr'
> 	at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.getXpathOrFuncExprNodeDesc(TypeCheckProcFactory.java:678)
> 	at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.process(TypeCheckProcFactory.java:908)
> 	at org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:89)
> 	at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:87)
> 	at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.walk(DefaultGraphWalker.java:124)
> 	at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:101)
> 	at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory.genExprNode(TypeCheckProcFactory.java:166)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:8895)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genSelectPlan(SemanticAnalyzer.java:2634)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genSelectPlan(SemanticAnalyzer.java:2433)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPostGroupByBodyPlan(SemanticAnalyzer.java:7234)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:7200)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:7978)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:8651)
> 	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:259)
> 	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:431)
> 	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:335)
> 	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:898)
> 	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
> 	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
> 	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
> 	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756)
> 	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
> 	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)
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message