hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashutosh Chauhan (JIRA)" <>
Subject [jira] [Commented] (HIVE-16924) Support distinct in presence Gby
Date Tue, 20 Jun 2017 22:44:00 GMT


Ashutosh Chauhan commented on HIVE-16924:

In general case this needs two Gby. First to compute group by and aggregates and second to
do distinct with Gby keys as all columns in select list. 
Queries in example provided can actually be computed by single Gby, but thats an optimization
which potentially can be done in a follow-up.

> Support distinct in presence Gby 
> ---------------------------------
>                 Key: HIVE-16924
>                 URL:
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Planning
>            Reporter: Carter Shanklin
> create table e011_01 (c1 int, c2 smallint);
> insert into e011_01 values (1, 1), (2, 2);
> These queries should work:
> select distinct c1, count(*) from e011_01 group by c1;
> select distinct c1, avg(c2) from e011_01 group by c1;
> Currently, you get : 
> FAILED: SemanticException 1:52 SELECT DISTINCT and GROUP BY can not be in the same query.
Error encountered near token 'c1'

This message was sent by Atlassian JIRA

View raw message