本文介绍了蜂巢中间隔的范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
美好的一天,请给我建议,我该如何替换此Oracle语法:
Good day, Give me advice,please, How can i replace this Oracle syntax:
sum(fact) over(partition by name order by rep_date range between interval '20' month preceding and current row) as w_sum要在Hive中使用它?我有一个与时间间隔"20"有关的错误
to use it in Hive? I have a mistake related with interval '20'
推荐答案使用unix_timestamp将rep_date转换为Unix纪元以来的秒数,然后计算20个月的秒数,并在两者之间的范围内使用.Hive不支持在范围内指定间隔类型.
Convert the rep_date into seconds since Unix epoch using unix_timestamp and then calculate the seconds for 20 months and use it in the range,between. Hive does not support specifying interval type in range.
sum(fact) over( partition by name order by unix_timestamp(rep_date,'MM-dd-yyyy') -- Specify the rep_date format here range between 51840000 preceding and current row) as w_sum更多推荐
蜂巢中间隔的范围
发布评论