You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Nitin Khandelwal (JIRA)" <ji...@apache.org> on 2017/12/27 08:38:00 UTC

[jira] [Created] (HIVE-18345) Incorrect Error Message when column is not present in GroupBy clause

Nitin Khandelwal created HIVE-18345:
---------------------------------------

             Summary: Incorrect Error Message when column is not present in GroupBy clause
                 Key: HIVE-18345
                 URL: https://issues.apache.org/jira/browse/HIVE-18345
             Project: Hive
          Issue Type: Improvement
          Components: Query Planning
    Affects Versions: 2.1.0
            Reporter: Nitin Khandelwal
            Priority: Minor


Hive gives the error message  - _Expression not in GROUP BY key_ if a column which is not present in GBY clause is projected without aggregation.
Example:
{code:sql}
Select x,y from A group by y;
FAILED: SemanticException Error 10025: Line 1:7 Expression not in GROUP BY key 'x'
{code}

But, in case of a subquery, the error message is misleading.
{code:sql}
CREATE TABLE A(x int, y int);
Select a.x, a.y from (select x, y from A) as a group by a.y;
FAILED: SemanticException Error 10002: Line 1:9 Invalid column reference 'x'
{code}




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)