CREATE DATABASE IF NOT EXISTS internal_platform_db; CREATE TABLE IF NOT EXISTS internal_platform_db.app_group_product_info_query_engine_011 ( username STRING, application_group STRING, application_group_owner INT, product_id INT, product_name STRING, product_owner INT, obs_product_id INT, obs_product_name STRING, obs_product_owner INT, department STRING, plan_product_id INT, plan_product_name STRING, plan_product_owner INT, application_group_numbers STRING, application_group_owners STRING, product_owners STRING, obs_product_owners STRING, plan_product_owners STRING, bg STRING, id INT ) STORED AS ORC; INSERT INTO TABLE internal_platform_db.app_group_product_info_query_engine_011 VALUES ('user_a', 'group_alpha', 1, 101, 'prod_x', 201, 301, 'obs_prod_a', 401, 'dept_eng', 501, 'plan_a', 601, '5', 'owner1', 'powner1', 'obs_owner1', 'plan_owner1', 'BG1', 1), ('user_b', 'group_beta', 2, 102, 'prod_y', 202, 302, 'obs_prod_b', 402, 'dept_sales', 502, 'plan_b', 602, '10', 'owner2', 'powner2', 'obs_owner2', 'plan_owner2', 'BG2', 2), ('user_c', 'group_gamma', 3, 103, 'prod_z', 203, 303, 'obs_prod_c', 403, 'dept_hr', 503, 'plan_c', 603, '3', 'owner3', 'powner3', 'obs_owner3', 'plan_owner3', 'BG1', 3), ('user_d', 'group_alpha', 1, 104, 'prod_w', 204, 304, 'obs_prod_d', 404, 'dept_eng', 504, 'plan_d', 604, '7', 'owner4', 'powner4', 'obs_owner4', 'plan_owner4', 'BG3', 4), ('user_e', 'group_delta', 4, 105, 'prod_v', 205, 305, 'obs_prod_e', 405, 'dept_finance', 505, 'plan_e', 605, '2', 'owner5', 'powner5', 'obs_owner5', 'plan_owner5', 'BG2', 5); CREATE TABLE IF NOT EXISTS internal_platform_db.app_group_product_info_history_query_engine_011 ( username STRING, application_group STRING, application_group_owner INT, product_id INT, product_name STRING, product_owner INT, obs_product_id INT, obs_product_name STRING, obs_product_owner INT, department STRING, plan_product_id INT, plan_product_name STRING, plan_product_owner INT, application_group_numbers STRING, application_group_owners STRING, product_owners STRING, obs_product_owners STRING, plan_product_owners STRING, bg STRING, id INT ) PARTITIONED BY (dt STRING) STORED AS ORC; -- Agent 候选目标表 CREATE TABLE IF NOT EXISTS internal_platform_db.app_group_product_info_history_cand_query_engine_011 ( username STRING, application_group STRING, application_group_owner INT, product_id INT, product_name STRING, product_owner INT, obs_product_id INT, obs_product_name STRING, obs_product_owner INT, department STRING, plan_product_id INT, plan_product_name STRING, plan_product_owner INT, application_group_numbers STRING, application_group_owners STRING, product_owners STRING, obs_product_owners STRING, plan_product_owners STRING, bg STRING, id INT ) PARTITIONED BY (dt STRING) STORED AS ORC;