CREATE TRANSIENT TABLE ml_recs_web_song_feed (
    user_id VARCHAR(255) COMMENT 'User Id',
    user_uid VARCHAR(255) COMMENT 'User UID ',
    clip_id VARCHAR(255) COMMENT 'Clip Id',
    section_id VARCHAR(255) COMMENT 'Feed section identifier (featured_feed_following, featured_feed_for_you, featured_feed_trending)',
    p_date DATE COMMENT 'Processing date for the data',
    
    -- Engagement metrics from ml_recs_web_song_feed_engagement
    song_feed_item_seen_cnt NUMBER COMMENT 'Number of times the song feed item was viewed',
    song_feed_item_title_clicked_cnt NUMBER COMMENT 'Number of times the song title was clicked',
    song_feed_item_artist_clicked_cnt NUMBER COMMENT 'Number of times the artist name was clicked',
    song_feed_item_like_clicked_cnt NUMBER COMMENT 'Number of times the like button was clicked',
    song_feed_item_play_clicked_cnt NUMBER COMMENT 'Number of times the play button was clicked',
    song_feed_item_comments_clicked_cnt NUMBER COMMENT 'Number of times the comments section was clicked',
    total_action_cnt NUMBER COMMENT 'Total number of engagement actions performed',
    
    -- Play metrics from fact_play
    total_play_cnt NUMBER COMMENT 'Total number of any play events',
    play_duration_gt_5_sec_play_cnt NUMBER COMMENT 'Number of plays longer than 5 seconds',
    play_duration_gt_50_percent_clip_length_play_cnt NUMBER COMMENT 'Number of plays that exceeded 50% of clip length',
    play_duration_gt_90_percent_clip_length_play_cnt NUMBER COMMENT 'Number of plays that exceeded 90% of clip length',
    end_due_to_click_forward_play_cnt NUMBER COMMENT 'Number of play events due to click forward play'
)
