#sql #databricks #presto
Вопрос:
Я пытаюсь преобразовать запрос presto в дельту ссылок данных и получаю сообщение об ошибке из-за функции unnest. Любая помощь будет признательна.
Запрос Presto
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 )