Hive 中的 4 小时报告
我有一个带有列的配置单元表 -> date, hr, count
其中 date, hr
是分区。考虑到我手头有数据和时间,我想查询表中的4小时汇总数据
。
示例->如果我的日期为 2012-02-08,小时为 02,则汇总报告应包含 2012-02-07,23|2012-02-08,00|2012-02-08,01 的汇总计数|2012-02-08,02
我想知道有没有一种方法可以一次性查询。
谢谢
I have a hive table with columns -> date, hr, count
where date, hr
are partitions. I want to query the table for 4 hours summarized data
considering i have data and time in hand.
Example -> If i have date as 2012-02-08 and hr as 02 then the summarized report should contain be summarized count of 2012-02-07,23|2012-02-08,00|2012-02-08,01|2012-02-08,02
I would like to know is there a way to query in one shot.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不按日期和小时分组:
还有一些额外的日期和时间函数,可能有用,例如小时(日期时间)或分钟,天。
Why not do a group by where you group by date and hr:
Also have has some extra date and time functions that might be useful like hour(datetime) or minute, day.