蜂巢中间隔的范围

编程入门 行业动态 更新时间:2024-10-09 22:19:05
本文介绍了蜂巢中间隔的范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

美好的一天,请给我建议,我该如何替换此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

更多推荐

蜂巢中间隔的范围

本文发布于:2023-11-30 22:00:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1651600.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:蜂巢   间隔

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!