You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by 何翔 <ca...@gmail.com> on 2010/06/23 11:05:21 UTC

Strange limitations(or bugs?) in Hive QL

I find Hive QL has some strange limitations(or bugs?) unlike SQL:
1. If there are group_by clause in Hive QL, the column names in the select
clause must be included in grouy_by clause.
     e.g. "SELECT A.a, A.b, SUM(A.c) FROM A GROUP BY A.a" is illegal, since
"A.b" in the select clause is not in the group_by clause.

2. The column names in the order_by clause must be included select clause.
    e.g. "SELECT A.a FROM A ORDER BY A.b" is illegal, since "A.b" in the
order_by clause is not in the select clause.

3. If there are group_by clause and order_by clause in Hive QL, the column
names in the order_by clause are forbidden to prefixed with the table name
or alias.
    e.g. "SELECT A.a, SUM(A.b) FROM A GROUP BY A.a ORDER BY A.a" is illegal,
since "A.a" in the order_by clause is prefixed with A.
        But both "SELECT A.a AS c, A.b FROM A GROUP BY A.a ORDER BY c"
and "SELECT
A.a FROM A ORDER BY A.a"is ok.

 Especially for point 3 it is not reasonable.

Yours sincerely,
Clyde