Datasets:
metadata
id: offline-compute_HiveSQL_hivesql_005
name: 从 internal_platform_db.dws_mq_production_featur
category: offline-compute/HiveSQL
timeout_seconds: 600
modality: pure-text
engine: hivesql
Prompt
任务目标:汇总当天有生产量的 消息队列MQ topic 维度信息及近7/30/90天生产统计,落地为 topic 治理项明细表。
输入:
- 表:internal_platform_db.dws_mq_production_feature_d_increase_query_engine_013
- 分区字段:dt(STRING,格式 YYYYMMDD)
- 关键字段:business_id、business_name、topic、cluster_set、tenant、namespaces、system_belong、dw_appgroup、in_charge、description、create_time、modify_time、cluster_id、cluster_type、cluster_name、bg、category_name、total_produce_pkg_d、production_days_last_7d、total_produce_pkg_last_7d、production_days_last_30d、total_produce_pkg_last_30d、production_days_last_90d、total_produce_pkg_last_90d、is_consumed、has_consumption_days_last_7d、has_consumption_days_last_30d、has_consumption_days_last_90d
处理规则:
- 过滤条件:dt = '20260507' AND total_produce_pkg_last_90d > 0
- 无 Join,单表处理
- 派生字段:
- mq_full_topic:若 tenant 和 namespaces 均非 NULL,则拼接为 'persistent://' + tenant + '/' + namespaces + '/' + topic;否则直接取 topic
- app_group:取自 dw_appgroup
- bid_incharge:取自 in_charge
- bid_description:取自 description
- bid_create_time:取自 create_time
- bid_modify_time:取自 modify_time
- hitted_gov_items:固定为 NULL
- governance_benefit_estimate:固定为 NULL
输出要求:
- 输出字段顺序:dt、business_id、business_name、topic、cluster_set、mq_full_topic、system_belong、app_group、bid_incharge、bid_description、bid_create_time、bid_modify_time、cluster_id、cluster_type、cluster_name、bg、category_name、total_produce_pkg_d、production_days_last_7d、total_produce_pkg_last_7d、production_days_last_30d、total_produce_pkg_last_30d、production_days_last_90d、total_produce_pkg_last_90d、is_consumed、has_consumption_days_last_7d、has_consumption_days_last_30d、has_consumption_days_last_90d、hitted_gov_items、governance_benefit_estimate
写入要求:
- 目标表:internal_platform_db.ads_mq_topic_governance_item_d_cand_query_engine_013
- 分区字段:dt(STRING,格式 YYYYMMDD)
- 写入方式:INSERT OVERWRITE 按分区写入
- 若目标表不存在,先按 Hive 标准建表(ORC存储、按 dt 分区),再写入
请将最终 HiveSQL 写入 result.sql 并执行。