You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/01/29 16:15:00 UTC

[jira] [Work logged] (HIVE-24478) Subquery GroupBy with Distinct SemanticException: Invalid column reference

     [ https://issues.apache.org/jira/browse/HIVE-24478?focusedWorklogId=544332&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-544332 ]

ASF GitHub Bot logged work on HIVE-24478:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Jan/21 16:14
            Start Date: 29/Jan/21 16:14
    Worklog Time Spent: 10m 
      Work Description: pgaref commented on pull request #1732:
URL: https://github.com/apache/hive/pull/1732#issuecomment-769899486


   Hey @jcamachor @maheshk114  can you please take a look?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 544332)
    Time Spent: 20m  (was: 10m)

> Subquery GroupBy with Distinct SemanticException: Invalid column reference
> --------------------------------------------------------------------------
>
>                 Key: HIVE-24478
>                 URL: https://issues.apache.org/jira/browse/HIVE-24478
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Panagiotis Garefalakis
>            Assignee: Panagiotis Garefalakis
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {code:java}
> CREATE TABLE tmp_src1(
>   `npp` string,
>   `nsoc` string) stored as orc;
> INSERT INTO tmp_src1 (npp,nsoc) VALUES ('1-1000CG61', '7273111');
> SELECT `min_nsoc`
> FROM
>      (SELECT `npp`,
>              MIN(`nsoc`) AS `min_nsoc`,
>              COUNT(DISTINCT `nsoc`) AS `nb_nsoc`
>       FROM tmp_src1
>       GROUP BY `npp`) `a`
> WHERE `nb_nsoc` > 0;
> {code}
> Issue:
> {code:java}
> org.apache.hadoop.hive.ql.parse.SemanticException: Line 0:-1 Invalid column reference 'nsoc' at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genGroupByPlanGroupByOperator1(SemanticAnalyzer.java:5405)
> {code}
> Query runs fine when we include `nb_nsoc` in the Select expression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)