create or replace task WEB_AUDIO_ACTIONS_DAILY_INSERT
	warehouse=SUNO_PROD_WEB_DAILY_X_SMALL
	schedule='USING CRON 0 6 * * * UTC'
	as DECLARE
        file_name string;
        geo_table_name string;
        p_date date;
    BEGIN
        file_name := CONCAT('@SUNO_S3_EVENTS/Audio-Action-Event/0/', YEAR(SYSDATE() - INTERVAL '1 DAY'), '/', MONTH(SYSDATE() - INTERVAL '1 DAY'), '/', DAY(SYSDATE() - INTERVAL '1 DAY'));
        p_date := Date(SYSDATE() - INTERVAL '1 DAY');
        geo_table_name := CONCAT('Audio_Action_Event_', YEAR(SYSDATE() - INTERVAL '1 DAY'), '_', MONTH(SYSDATE() - INTERVAL '1 DAY'), '_', DAY(SYSDATE() - INTERVAL '1 DAY'));
        CALL WEB_AUDIO_ACTIONS_DAILY_INSERT_PROC(
            :file_name,
            :p_date,
            :geo_table_name
        );
    END;
