SemanticException Range based Window Frame can have only 1 Sort Key

select
sum(money) over(partition by id order by datekey,id)
from table_test;

在运行这个语句的时候报错
Error while compiling statement: FAILED: SemanticException Range based Window Frame can have only 1 Sort Key

解决方案

显式窗口子句可能会解决错误:

select sum(money) over (partition by id order by datekey,id
                          rows between unbounded preceding and current row
                         )
from table_test

你可能感兴趣的:(hive)