Hive
  1. Hive
  2. HIVE-2709

Semantic Analysis failed for GroupBy query with aliase.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.8.0
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      None
    • Environment:

      SuSE11 SP1

      Description

      In the SQL ,

      "select empno from test t group by t.empno"

      type of query work fine where as in hive ,below exception

      "org.apache.hadoop.hive.ql.parse.SemanticException: line 1:7 Expression Not In Group By Key ename".

      For the above, column_name with aliase work fine i.e

      "select t.empno from test t group by t.empno" is work fine.

        Activity

        Hide
        Phabricator added a comment -

        navis updated the revision "HIVE-2709 [jira] Semantic Analysis failed for GroupBy query with aliase.".
        Reviewers: JIRA

        support searching table.column from column name
        move notable_alias3 to positive

        REVISION DETAIL
        https://reviews.facebook.net/D1305

        AFFECTED FILES
        ql/src/java/org/apache/hadoop/hive/ql/parse/ExprRowResolver.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
        ql/src/test/queries/clientpositive/groupby_alias.q
        ql/src/test/queries/clientpositive/notable_alias3.q
        ql/src/test/queries/clientnegative/notable_alias3.q
        ql/src/test/results/clientpositive/groupby_alias.q.out
        ql/src/test/results/clientpositive/notable_alias3.q.out

        Show
        Phabricator added a comment - navis updated the revision " HIVE-2709 [jira] Semantic Analysis failed for GroupBy query with aliase.". Reviewers: JIRA support searching table.column from column name move notable_alias3 to positive REVISION DETAIL https://reviews.facebook.net/D1305 AFFECTED FILES ql/src/java/org/apache/hadoop/hive/ql/parse/ExprRowResolver.java ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java ql/src/test/queries/clientpositive/groupby_alias.q ql/src/test/queries/clientpositive/notable_alias3.q ql/src/test/queries/clientnegative/notable_alias3.q ql/src/test/results/clientpositive/groupby_alias.q.out ql/src/test/results/clientpositive/notable_alias3.q.out
        Hide
        Phabricator added a comment -

        navis has commented on the revision "HIVE-2709 [jira] Semantic Analysis failed for GroupBy query with aliase.".

        Resolves HIVE-695, HIVE-1449, HIVE-2348, HIVE-2709

        REVISION DETAIL
        https://reviews.facebook.net/D1305

        Show
        Phabricator added a comment - navis has commented on the revision " HIVE-2709 [jira] Semantic Analysis failed for GroupBy query with aliase.". Resolves HIVE-695 , HIVE-1449 , HIVE-2348 , HIVE-2709 REVISION DETAIL https://reviews.facebook.net/D1305
        Hide
        Phabricator added a comment -

        navis requested code review of "HIVE-2709 [jira] Semantic Analysis failed for GroupBy query with aliase.".
        Reviewers: JIRA

        DPAL-625 Semantic Analysis failed for GroupBy query with aliase

        In the SQL ,

        "select empno from test t group by t.empno"

        type of query work fine where as in hive ,below exception

        "org.apache.hadoop.hive.ql.parse.SemanticException: line 1:7 Expression Not In Group By Key ename".

        For the above, column_name with aliase work fine i.e

        "select t.empno from test t group by t.empno" is work fine.

        TEST PLAN
        EMPTY

        REVISION DETAIL
        https://reviews.facebook.net/D1305

        AFFECTED FILES
        ql/src/java/org/apache/hadoop/hive/ql/parse/ExprRowResolver.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
        ql/src/test/queries/clientpositive/groupby_alias.q
        ql/src/test/results/clientpositive/groupby_alias.q.out

        MANAGE HERALD DIFFERENTIAL RULES
        https://reviews.facebook.net/herald/view/differential/

        WHY DID I GET THIS EMAIL?
        https://reviews.facebook.net/herald/transcript/2709/

        Tip: use the X-Herald-Rules header to filter Herald messages in your client.

        Show
        Phabricator added a comment - navis requested code review of " HIVE-2709 [jira] Semantic Analysis failed for GroupBy query with aliase.". Reviewers: JIRA DPAL-625 Semantic Analysis failed for GroupBy query with aliase In the SQL , "select empno from test t group by t.empno" type of query work fine where as in hive ,below exception "org.apache.hadoop.hive.ql.parse.SemanticException: line 1:7 Expression Not In Group By Key ename". For the above, column_name with aliase work fine i.e "select t.empno from test t group by t.empno" is work fine. TEST PLAN EMPTY REVISION DETAIL https://reviews.facebook.net/D1305 AFFECTED FILES ql/src/java/org/apache/hadoop/hive/ql/parse/ExprRowResolver.java ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java ql/src/test/queries/clientpositive/groupby_alias.q ql/src/test/results/clientpositive/groupby_alias.q.out MANAGE HERALD DIFFERENTIAL RULES https://reviews.facebook.net/herald/view/differential/ WHY DID I GET THIS EMAIL? https://reviews.facebook.net/herald/transcript/2709/ Tip: use the X-Herald-Rules header to filter Herald messages in your client.
        Hide
        Navis added a comment -

        Hive does not search column properly if row resolver of previous operator is expressional (rs or gby). If some equivalent logic is added, this issue could be resolved.

        Attached patch is just a simple scratch.

        Show
        Navis added a comment - Hive does not search column properly if row resolver of previous operator is expressional (rs or gby). If some equivalent logic is added, this issue could be resolved. Attached patch is just a simple scratch.

          People

          • Assignee:
            Unassigned
            Reporter:
            Rohith Sharma K S
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development