Hi Everyone,
I am using the below sql query to generate the days in order in hive & it is working fine. The table got migrated to delta and my query is failing. It would be appreciated if someone helps me to figure out the issue.
SQL Query :
with
explode_dates as (
with list_of_dates as (
SELECT CAST(date_column AS DATE) AS DAY
FROM (
VALUES (SEQUENCE(cast('2021-01-01' AS date), date_add('day',-1,current_date), INTERVAL '1' DAY) )
) AS t1(date_array)
CROSS JOIN UNNEST(date_array) AS t2(date_column)
)
select a.day as KPI_DATE, month(b.day) as dates_month, b.day as dates from list_of_dates a
join list_of_dates b on b.day between date_trunc('quarter', date_add('day',0,a.day)) and a.day )