Datasets:
metadata
id: offline-compute_HiveSQL_hivesql_026
name: >-
Merge 6 business detail tables from different scenarios (group, pd,
socialzone, social_scene, profile_page, group
category: offline-compute/HiveSQL
timeout_seconds: 600
modality: pure-text
engine: hivesql
Prompt
Task Objective
Merge 6 business detail tables from different scenarios using UNION ALL after date filtering, writing the results into a unified detail partitioned table.
Inputs
internal_platform_db.dwd_im_ads_businesses_core_scene_detail_group_di_query_engine_142internal_platform_db.dwd_im_ads_businesses_core_scene_detail_pd_di_query_engine_142internal_platform_db.dwd_im_ads_businesses_core_scene_detail_social_di_query_engine_142internal_platform_db.dwd_im_ads_businesses_core_scene_detail_social_scene_di_query_engine_142internal_platform_db.dwd_im_ads_businesses_core_scene_detail_profile_page_di_query_engine_142internal_platform_db.dwd_im_ads_businesses_core_scene_detail_group_profile_di_query_engine_142
Processing Rules
- No joins, single-table processing
- Filter condition:
imp_date = 20260608for all tables - Field alignment rules:
- 5 tables (group, socialzone, social_scene, profile_page, group_profile) use
SELECT *to output all 13 fields - The
pdtable has 15 fields; explicitly list the first 13 fields:imp_date,appid,message_id,puin,code,group_no,scene,sub_scene,hit_msg,is_punish_beat,new_reg_tag,payload_req,reg_date(excluding the trailingstrategy_idandstrategy_status)
- 5 tables (group, socialzone, social_scene, profile_page, group_profile) use
- Merge all results using UNION ALL, without deduplication
Output Requirements
Output field order: imp_date, appid, message_id, puin, code, group_no, scene, sub_scene, hit_msg, is_punish_beat, new_reg_tag, payload_req, reg_date
Write Requirements
- Target table:
internal_platform_db.dwd_im_ads_businesses_core_scene_detail_di_cand_query_engine_142 - Write method:
INSERT OVERWRITE - Partition field:
imp_date = 20260608
Please write the final HiveSQL to result.sql and execute it.