hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carter Shanklin (JIRA)" <>
Subject [jira] [Commented] (HIVE-16648) Allow select distinct with group by
Date Thu, 22 Jun 2017 15:04:02 GMT


Carter Shanklin commented on HIVE-16648:

To clarify I wasn't looking for a workaround but this case does come up when porting SQL from
other DBs to Hive, most mature SQL engines are smart enough to ignore the distinct clause
in this case.

Looks like HIVE-16924 is going to tackle the more complex case when aggregates are also present
but that should cover this one as well.

> Allow select distinct with group by
> -----------------------------------
>                 Key: HIVE-16648
>                 URL:
>             Project: Hive
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Carter Shanklin
>            Assignee: Anshuman
> Although there are very few legitimate reasons to have both "select distinct" and "group
by" in the same query, it is still used from time to time and other systems support it.
> Illustrating the issue:
> {code}
> hive> create table test (c1 integer);
> OK
> Time taken: 0.073 seconds
> hive> select distinct c1 from test group by c1;
> FAILED: SemanticException 1:38 SELECT DISTINCT and GROUP BY can not be in the same query.
Error encountered near token 'c1'
> {code}

This message was sent by Atlassian JIRA

View raw message