create or replace task SUNO_PROD.PROD.DIM_CLIP_HOURLY_INSERT
	warehouse=SUNO_PROD_OTHER_HOURLY_X_SMALL
	schedule='USING CRON 30 * * * * UTC'
	as declare
        start_time TIMESTAMP;
        p_date date;
        p_hour string;
        stage_path string;
        row_count number;
        sql string;
    begin
        start_time := CURRENT_TIMESTAMP();
        p_date := DATE(SYSDATE() - INTERVAL '1 HOUR');
        p_hour := LPAD(HOUR(SYSDATE() - INTERVAL '1 HOUR'), 2, '0');
        stage_path := '@SUNO_DATABASE_EVENTS/bots_generatedclip_insert/pdate=' || p_date || '/phour=' || p_hour;
        call DIM_CLIP_INSERT_PROC(:stage_path) into :row_count;
        call TASK_MONITOR_INSERT_PROC('DIM_CLIP_HOURLY_INSERT', :start_time, :row_count, 'SUCCESS', 'HOURLY');
    end;
