hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Meadows (Jira)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-15966) Query with column alias fails in order by
Date Thu, 23 Jul 2020 18:05:00 GMT

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

Alex Meadows commented on HIVE-15966:
-------------------------------------

I've run into this issue while trying to work with Hive and SQLAlchemy.  Having the alias
be used in the ORDER BY would allow for Hive to be leveraged in many various project types. 
For full details, here's the issue as noted on the SQLAlchemy project:  SQLAlchemy Github
Issue[https://github.com/sqlalchemy/sqlalchemy/issues/5472]

 

> Query with column alias fails in order by
> -----------------------------------------
>
>                 Key: HIVE-15966
>                 URL: https://issues.apache.org/jira/browse/HIVE-15966
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>            Reporter: Chaoyu Tang
>            Assignee: Chaoyu Tang
>            Priority: Major
>
> Query:  
> {code}
> select mtg.marketing_type_group_desc as marketing_type_group
> from marketing_type_group mtg 
> order by mtg.marketing_type_group_desc;
> {code}
> fails with error:
> {code}
> 2017-02-17T11:22:11,441 ERROR [eb89eafb-e100-42b1-8ff1-b3332b2e715f main]: ql.Driver
(SessionState.java:printError(1116)) - FAILED: SemanticException [Error 10004]: Line 7:9 Invalid
table alias or column reference 'marketing_type_group_desc': (possible column names are: marketing_type_group,
prod_type)
> org.apache.hadoop.hive.ql.parse.SemanticException: Line 7:9 Invalid table alias or column
reference 'marketing_type_group_desc': (possible column names are: marketing_type_group, prod_type)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genAllExprNodeDesc(SemanticAnalyzer.java:11501)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:11449)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:11417)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:11395)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genReduceSinkPlan(SemanticAnalyzer.java:7761)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPostGroupByBodyPlan(SemanticAnalyzer.java:9655)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:9554)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:10450)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:10328)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genOPTree(SemanticAnalyzer.java:11011)
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:478)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:11022)
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:285)
> 	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:258)
> 	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:514)
> 	at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1319)
> 	at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1459)
> 	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1239)
> 	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1229)
> 	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
> 	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
> 	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
> 	at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:821)
> 	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
> 	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
> 	at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
> {code}



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

Mime
View raw message