это ниже sql может быть вам полезно.
hive>
select from_unixtime(unix_timestamp(cast(20200802 as string),'yyyyMMdd'),'u') as weekdaynumber,
CASE from_unixtime(unix_timestamp(cast(20200802 as string),'yyyyMMdd'),'u')
WHEN 1 THEN 'Monday'
WHEN 2 THEN 'Tuesday'
WHEN 3 THEN 'Wedneday'
WHEN 4 THEN 'Thursday'
WHEN 5 THEN 'Friday'
WHEN 6 THEN 'Saturday'
WHEN 7 THEN 'Sunday'
END AS day_of_week
OK
7 Sunday