【发布时间】:2018-10-27 01:40:17
【问题描述】:
我有一个包含以下数据的表格:
dt device id count
2018-10-05 computer 7541185957382 6
2018-10-20 computer 7541185957382 3
2018-10-14 computer 7553187775734 6
2018-10-17 computer 7553187775734 10
2018-10-21 computer 7553187775734 2
2018-10-22 computer 7549187067178 5
2018-10-20 computer 7553187757256 3
2018-10-11 computer 7549187067178 10
我想为每个id 获取最后一个和第一个dt。因此,我使用窗口函数 first_value 和 last_value 如下:
select id,last_value(dt) over (partition by id order by dt) last_dt
from table
order by id
;
但我收到此错误:
FAILED: SemanticException Failed to breakup Windowing invocations into Groups. At least 1 group must only depend on input columns. Also check for circular dependencies.
Underlying error: Primitve type DATE not supported in Value Boundary expression
我无法诊断问题,如果能提供任何帮助,我将不胜感激。
【问题讨论】:
标签: hive hiveql window-functions