hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhenxiao Luo (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-2228) Can't use DB qualified column names in WHERE or GROUP BY clauses
Date Sat, 06 Oct 2012 05:14:02 GMT

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

Zhenxiao Luo commented on HIVE-2228:
------------------------------------

@Namit: Thanks for the comment.
You are correct, none of the other clauses working: SORT BY, ORDER BY, CLUSTER BY, and DISTRIBUTE
BY.

I filed HIVE-3542 and link with this ticket.
                
> Can't use DB qualified column names in WHERE or GROUP BY clauses
> ----------------------------------------------------------------
>
>                 Key: HIVE-2228
>                 URL: https://issues.apache.org/jira/browse/HIVE-2228
>             Project: Hive
>          Issue Type: Bug
>          Components: Database/Schema, Query Processor, SQL
>    Affects Versions: 0.7.0
>            Reporter: Carl Steinbach
>            Assignee: Zhenxiao Luo
>         Attachments: HIVE-2228.1.patch.txt
>
>
> Hive doesn't allow you to use DB qualified column names in the WHERE or GROUP BY clauses.
The workaround is to define a table alias:
> {noformat}
> hive> CREATE DATABASE db1;
> OK
> hive> CREATE TABLE db1.t(a INT, b INT);
> OK
> hive> SELECT * FROM db1.t WHERE db1.t.a > 100;
> FAILED: Error in semantic analysis: Line 1:26 Invalid table alias or column reference
'db1'
> hive> SELECT * FROM db1.t t WHERE t.a > 100;
> OK
> hive> SELECT * FROM db1.t GROUP BY db1.t.a;
> FAILED: Error in semantic analysis: Line 1:29 Invalid table alias or column reference
'db1'
> hive> SELECT * FROM db1.t t GROUP BY t.a;
> OK
> {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