[
https://issues.apache.org/jira/browse/HIVE-1683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15721729#comment-15721729
]
Dudu Markovitz edited comment on HIVE-1683 at 12/5/16 9:35 AM:
---------------------------------------------------------------
There was no reason to close this issue.
The execution flow is not relevant, the important thing is that the full query
is known at parsing time and therefore aliases can be expand to their source
expressions no matter where they are located.
Teradata for example supports aliases in every part of the query including
SELECT and WHERE.
e.g.
select length(x) as len_x,case when len_x > 10 then 'Y' else 'N' end ...
select length(x) as len_x from ... where len_x > 10
was (Author: dmarkovitz):
There was no reason to close this issue.
The execution flow is not relevant, the important thing is that the full query
is known at parsing time and therefore aliases can be expand to their source
expressions no matter where they are located.
Teradata for example supports aliases in every part of the query including
SELECT and WHERE.
e.g.
bq. select length(x) as len_x,case when len_x > 10 then 'Y' else 'N' end ...
bq. select length(x) as len_x from ... where len_x > 10
> Column aliases cannot be used in a group by clause
> --------------------------------------------------
>
> Key: HIVE-1683
> URL: https://issues.apache.org/jira/browse/HIVE-1683
> Project: Hive
> Issue Type: Bug
> Components: Metastore
> Reporter: Shrikrishna Lawande
> Labels: SQL
>
> Column aliases cannot be used in a group by clause
> Following query would fail :
> select col1 as t, count(col2) from test group by t;
> FAILED: Error in semantic analysis: line 1:49 Invalid Table Alias or Column
> Reference t
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)