hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pengcheng Xiong (JIRA)" <>
Subject [jira] [Created] (HIVE-15160) Can't group by an unselected column
Date Tue, 08 Nov 2016 18:42:58 GMT
Pengcheng Xiong created HIVE-15160:

             Summary: Can't group by an unselected column
                 Key: HIVE-15160
             Project: Hive
          Issue Type: Bug
            Reporter: Pengcheng Xiong
            Assignee: Pengcheng Xiong

If a grouping key hasn't been selected, Hive complains. For comparison, Postgres does not.

Example. Notice i_item_id is not selected:

select  i_item_desc
       ,sum(cs_ext_sales_price) as itemrevenue
       ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over
           (partition by i_class) as revenueratio
 from	catalog_sales
 where cs_item_sk = i_item_sk
   and i_category in ('Jewelry', 'Sports', 'Books')
   and cs_sold_date_sk = d_date_sk
 and d_date between cast('2001-01-12' as date)
 				and (cast('2001-01-12' as date) + 30 days)
 group by i_item_id
 order by i_category
limit 100;

This message was sent by Atlassian JIRA

View raw message