HIVE排序函数大小写问题

hive版本: 0.11.0

在执行dense_rank

hive语句:

select ta.cookie_id
, ta.interest_ratio
, ta.goods_id
, DENSE_RANK() over (order by ta.COOKIE_ID) as RN
from tm_rec_user_cf_goods_visit ta
where ta.goods_cnt = 6
group by ta.cookie_id,ta.goods_id,ta.interest_ratio

HIVE的报错信息如下:

 

HiveServerException(Message: Query returned non-zero code: 40000, cause: 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: org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException: One or more arguments are expected.,ErrorCode: 40000,SQLState: 42000)

 

解决办法:

将 DENSE_RANK 改成 dense_rank

然后在执行 就没有问题了。

rank函数也有同样的问题。

ROW_NUMBER函数不会有同样的错误。

你可能感兴趣的