You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Dudu Markovitz (JIRA)" <ji...@apache.org> on 2016/12/05 09:33:58 UTC

[jira] [Commented] (HIVE-1683) Column aliases cannot be used in a group by clause

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

Dudu Markovitz commented on HIVE-1683:
--------------------------------------

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


> 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)