Hive 窗口函数如何设置窗口大小
生活随笔
收集整理的這篇文章主要介紹了
Hive 窗口函数如何设置窗口大小
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
select city,year,taxes,sum(money) over() as sample1,--所有行相加sum(money) over(partition by city) as sample2,--按city分組,組內數據相加sum(money) over(partition by city order by year) as sample3,--按city分組,組內數據累加sum(money) over(partition by city order by year rows between UNBOUNDED PRECEDING and current row ) as sample4 ,--和sample3一樣,由起點到當前行的聚合sum(money) over(partition by city order by year rows between 1 PRECEDING and current row) as sample5, --當前行和前面一行做聚合sum(money) over(partition by city order by year rows between 1 PRECEDING and 1 FOLLOWING ) as sample6,--當前行和前邊一行及后面一行sum(money) over(partition by city order by year rows between current row and UNBOUNDED FOLLOWING ) as sample7 --當前行及后面所有行from business;
總結
以上是生活随笔為你收集整理的Hive 窗口函数如何设置窗口大小的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 智能雷达存在感知技术,家居场景方案应用,
- 下一篇: PS插件的作用