Hive 为什么此配置单元QL应按“ds”分组?

Hive 为什么此配置单元QL应按“ds”分组?,hive,hiveql,Hive,Hiveql,ds=yyyyMMdd,日期\时间为yyyymmds分区100和楼层 我只是按字段1date_time分组,但为什么编译器说它应该按“ds”分组呢 编辑: ds是分区的字段。可以对原始列数据进行配置单元分组 select (floor(cast(ds as bigint)/100)) as date_time, count(DISTINCT trans_id) as n_trans from xxx where ds >= "20140301" and adzone_id = '1026

ds=yyyyMMdd,日期\时间为yyyymmds分区100和楼层

我只是按字段1date_time分组,但为什么编译器说它应该按“ds”分组呢

编辑:


ds是分区的字段。

可以对原始列数据进行配置单元分组

select 
(floor(cast(ds as bigint)/100)) as date_time,
count(DISTINCT trans_id) as n_trans
from xxx
where ds >= "20140301" and adzone_id = '10263209'
group by 1;
Begin execute SQL: select 
(floor(cast(ds as bigint)/100)) as date_time,
count(DISTINCT trans_id) as n_trans
from xxx
where ds >= "20140301" and adzone_id = '10263209'
group by 1
Hive history file=/xxx.txt
FAILED: Error in semantic analysis: Line 0:-1 Expression not in GROUP BY key 'ds'
over