CREATE DATABASE IF NOT EXISTS internal_platform_db; -- Input table CREATE TABLE IF NOT EXISTS internal_platform_db.dwm_news_plugin_ai_assistant_send_process_flow_hi_prestosql_006 ( imp_hour BIGINT, user_id STRING, content_id STRING, push_id STRING, pos STRING, send_cnt BIGINT, panel_exp_cnt BIGINT, pgin_pv BIGINT, pos_desc STRING, account_code STRING ) STORED AS ORC; INSERT INTO TABLE internal_platform_db.dwm_news_plugin_ai_assistant_send_process_flow_hi_prestosql_006 VALUES (2026060910, 'user001', 'cont001', 'push001', 'pos1', 10, 5, 3, '首页推荐', 'biz1'), (2026060910, 'user002', 'cont002', 'push002', 'pos1', 8, 4, 2, '首页推荐', 'biz1'), (2026060910, 'user003', 'cont003', 'push003', 'pos2', 6, 3, 1, '热点推送', 'biz2'), (2026060910, 'user004', 'cont004', 'push004', 'pos2', 4, 2, 0, '热点推送', 'biz2'), (2026060911, 'user001', 'cont005', 'push005', 'pos1', 12, 6, 4, '首页推荐', 'biz1'), (2026060911, 'user005', 'cont006', 'push006', 'pos1', 7, 3, 2, '首页推荐', 'biz1'), (2026060911, 'user006', 'cont007', 'push007', 'pos2', 5, 2, 1, '热点推送', 'biz2'), (2026060911, 'user003', 'cont008', 'push008', 'pos3', 3, 1, 0, '个人中心', 'biz3'); -- GT output table CREATE TABLE IF NOT EXISTS internal_platform_db.ads_news_plugin_ai_assistant_hourly_report_prestosql_006 ( imp_hour BIGINT, scene STRING, send_cnt_dth BIGINT, send_uv_dth BIGINT, panel_exp_cnt_dth BIGINT, panel_exp_uv_dth BIGINT, pgin_pv_dth BIGINT, pgin_uv_dth BIGINT, send_cnt_1h BIGINT, send_uv_1h BIGINT, panel_exp_cnt_1h BIGINT, panel_exp_uv_1h BIGINT, pgin_pv_1h BIGINT, pgin_uv_1h BIGINT ) STORED AS ORC; -- Candidate output table CREATE TABLE IF NOT EXISTS internal_platform_db.ads_news_plugin_ai_assistant_hourly_report_cand_prestosql_006 ( imp_hour BIGINT, scene STRING, send_cnt_dth BIGINT, send_uv_dth BIGINT, panel_exp_cnt_dth BIGINT, panel_exp_uv_dth BIGINT, pgin_pv_dth BIGINT, pgin_uv_dth BIGINT, send_cnt_1h BIGINT, send_uv_1h BIGINT, panel_exp_cnt_1h BIGINT, panel_exp_uv_1h BIGINT, pgin_pv_1h BIGINT, pgin_uv_1h BIGINT ) STORED AS ORC;