[Author]: Julia
如题,在spark下运行带有分析函数的sql语句,程序报错,但是同样的语句在Hive环境下面运行正常。
sql:--这一段是实际想要执行的语句,里面用到了sum() over (partition by )函数,子查询单独执行是没有问题的
select sum(r_count) over(partition by a.day) sum_day,
a.r_count,
a.datetime_v1,
a.datetime_v2,
a.day
from (select count(*) r_count,
SUBSTR(cast(fld_datetime as char(18)), 1, 10) AS DATETIME_V1,
SUBSTR(cast(fld_datetime as char(18)), 12, 2) datetime_v2,