如何在Hadoop Hive中给定时间戳记以获取一周中第一天的日期? [英] How to get the Date of the first day of a week given a time stamp in Hadoop Hive?
本文介绍了如何在Hadoop Hive中给定时间戳记以获取一周中第一天的日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
除了编写支持该问题的自定义UDF之外,是否有任何已知的方法可以实现此目的?我当前正在使用Hive 0.13.
Besides writing a custom UDF to support this issue, is there any known methods of achieving this? I'm currently using Hive 0.13.
推荐答案
date_sub(m.invitationdate,pmod(datediff(m.invitationdate,'1900-01-07'),7))
此表达式为我的问题提供了确切的解决方案.
This expression gives the exact solution to my question.
此致
鲍里斯
这篇关于如何在Hadoop Hive中给定时间戳记以获取一周中第一天的日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文