task_id stringlengths 9 16 | id stringlengths 31 39 | name stringlengths 7 145 | workload stringclasses 2
values | engine stringclasses 5
values | category stringclasses 5
values | language stringclasses 2
values | modality stringclasses 1
value | timeout_seconds int64 600 1.8k | prompt stringlengths 386 5.82k | ground_truth stringlengths 317 30k | expected_csv stringlengths 0 5.39k | grade_spec_csv stringlengths 0 1.01k | path stringlengths 37 48 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hivesql_001_en | offline-compute_HiveSQL_hivesql_001 | Message Queue Topic Dimension Table internal_platform_db.dim_mq_topic_d_su | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
**Task Objective**: Read data from the previous day's partition of the input table and copy it as-is to the output table's current day partition.
**Time Variables**: The platform provides these variables for dynamic date computation:
- `${yyyymmdd}` : current day in YYYYMMDD format
- `${yyyymmdd-1}` : previo... | INSERT overwrite TABLE internal_platform_db.dim_mq_topic_d_copilot_query_engine_001 PARTITION (dt = '20260507')
SELECT
business_id
,business_name
,cluster_set
,tenant
,namespaces
,topic
,mq_type
,dw_appgroup
,in_charge
,description
,create_time
,modify_time
,cluster_id
,cluster_type
,clust... | business_id,business_name,cluster_set,tenant,namespaces,topic,mq_type,dw_appgroup,in_charge,description,create_time,modify_time,cluster_id,cluster_type,cluster_name,bg,category_name,is_filtered,tids,consumed_tids,unconsumed_tids,is_fully_consumed,has_unconsumed_tid,system_belong,dt
bid001,BizName1,cluster_set_a,tenant_... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,25列(5) + 列名匹配(5)
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_field_value_match,field_value_match,25,非key字段逐列值匹配率
D,D_field_completeness,field_completeness,15,关键字段非空/非空串比例
F,F_insert_overwrite,insert_overwrite,... | tasks/offline-compute/HiveSQL/hivesql_001_en |
hivesql_002 | offline-compute_HiveSQL_hivesql_002 | 统计数据平台WDNotebook Ray类型管道任务中运行时间跨自然天的实例明细。从`wedat | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
**任务目标**:统计数据平台WDNotebook Ray类型管道任务中运行时间跨自然天的实例明细,按自然天拆分并关联GPU指标。
**输入**:
- `internal_platform_db.notebook_span_info_query_engine_005`
- `internal_platform_db.dwd_gputj_service_instance_map_query_engine_005`
- `internal_platform_db.dwd_ml_platform_instance_podname_query_engine_005`
- `internal_platform_db.gp... | INSERT overwrite TABLE internal_platform_db.dwd_notebook_instance_pod_cross_day_detail_d_query_engine_005 PARTITION (dt = '20260507')
WITH
base_data_raw AS (
SELECT DISTINCT
trace_id,
span_name,
start_time,
end_time,
datawd_project_id,
datawd_task_id,
datawd_t... | trace_id,datawd_project_id,datawd_task_id,datawd_task_instance_id,compute_type,status_code,instance_run_time,code_run_time,resource_wait_time,code_start_time,code_end_time,instance_start_time,instance_end_time,serving_id,is_permanent,apply_for_gpu_count,pod_name,pkg_agg_time,gpu_util,gpu_count,p_date,dt
trace_001,proj_... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,22列 + 列名匹配
C,C_row_alignment,row_consistency,10,行数比例 + key覆盖率
D,D_time_calculation,time_calculation,30,"instance_run_time, code_run_time 等时间指标"
D,D_cross_day_split,cross_day_split,15,trace_001 应出现在两天中
D,D_dimension_join,dimens... | tasks/offline-compute/HiveSQL/hivesql_002 |
hivesql_003 | offline-compute_HiveSQL_hivesql_003 | 从 `internal_platform_db.notebook_span_info_query_engine | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
1) 任务目标
识别并统计 Notebook 管道中被异常 kill 且缺失正常完成信号的 Ray 实例,按天拆分计算运行时长、代码执行时长、资源等待时长及 GPU 申请数。
2) 输入
- `internal_platform_db.notebook_span_info_query_engine_007`
- `internal_platform_db.notebook_engine_info_query_engine_007`
3) 处理规则
- 目标实例筛选:从 span_info 筛选 `compute_type='ray'` 且 `service_name='notebook-runner'` 的实... | INSERT overwrite TABLE internal_platform_db.dwd_notebook_killed_instance_detail_d_copilot_query_engine_007 PARTITION (dt = '20260507')
WITH base_trace AS (
SELECT trace_id
FROM internal_platform_db.notebook_span_info_query_engine_007
WHERE databus_imp_date >= '2026050700'
AND databus_imp_date <= '2026... | p_date,trace_id,datawd_project_id,datawd_task_id,datawd_task_instance_id,compute_type,status_code,instance_run_time,code_run_time,resource_wait_time,code_start_time,code_end_time,instance_start_time,instance_end_time,serving_id,is_permanent,apply_for_gpu_count,dt
2025-05-07,trace_001,proj_01,task_01,inst_01,ray,2,15,13... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,18列 + 列名匹配
C,C_row_alignment,row_consistency,10,行数比例 + key覆盖率
D,D_time_calculation,time_calculation,30,"instance_run_time, code_run_time 等时间指标"
D,D_cross_day_split,cross_day_split,15,跨天 trace 按天拆分正确性
D,D_engine_join,engine_joi... | tasks/offline-compute/HiveSQL/hivesql_003 |
hivesql_004 | offline-compute_HiveSQL_hivesql_004 | 将源表 internal_platform_db.app_group_product_info_sup | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
任务目标:将应用组与产品归属关系按天做历史快照,按分区全量覆盖写入目标表。
输入:internal_platform_db.app_group_product_info_query_engine_011
- 字段:username、application_group、application_group_owner、product_id、product_name、product_owner、obs_product_id、obs_product_name、obs_product_owner、department、plan_product_id、plan_product_name、plan_product_owner... | insert overwrite TABLE internal_platform_db.app_group_product_info_history_query_engine_011 PARTITION (dt = '20260507')
SELECT
username,
application_group,
application_group_owner,
product_id,
product_name,
product_owner,
obs_product_id,
obs_product_name,
obs_product_owner,
department,
plan_product_id,
plan_product_nam... | username,application_group,application_group_owner,product_id,product_name,product_owner,obs_product_id,obs_product_name,obs_product_owner,department,plan_product_id,plan_product_name,plan_product_owner,application_group_numbers,application_group_owners,product_owners,obs_product_owners,plan_product_owners,bg,id,dt
use... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,21列(5) + 列名匹配(5)
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_field_value_match,field_value_match,25,非key字段逐列值匹配率
D,D_field_completeness,field_completeness,15,关键字段非空/非空串比例
F,F_insert_overwrite,insert_overwrite,... | tasks/offline-compute/HiveSQL/hivesql_004 |
hivesql_005 | offline-compute_HiveSQL_hivesql_005 | 从 internal_platform_db.dws_mq_production_featur | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## 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、mo... | INSERT OVERWRITE TABLE internal_platform_db.ads_mq_topic_governance_item_d_query_engine_013 PARTITION (dt = '20260507')
SELECT
business_id,
business_name,
topic,
cluster_set,
IF ( tenant IS NOT NULL AND namespaces IS NOT NULL, CONCAT( 'persistent://', tenant, '/', namespaces, '/', topic ), topic ) AS mq_full_... | 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,p... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,30列(5) + 列名匹配(5)
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_field_mapping,field_mapping,25,字段别名映射正确性(app_group/bid_*等)
D,D_derived_mq_full_topic,derived_mq_full_topic,15,mq_full_topic 派生列拼接逻辑正确性
F,F_insert_ov... | tasks/offline-compute/HiveSQL/hivesql_005 |
hivesql_006_en | offline-compute_HiveSQL_hivesql_006 | Input Table internal_platform_db.ods_t_databus_access_topic | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective: Cleanse the 数据总线 topic access cost raw data and aggregate it by topic dimension, excluding test topics, then write the results to a detail table.
Input: `internal_platform_db.ods_t_databus_access_topic_cost_date_d_query_engine_015`, partitioned by field `dt` (STRING, YYYYMMDD). Key fields: `s... | INSERT overwrite TABLE internal_platform_db.dwd_databus_topic_cost_detail_d_query_engine_015 PARTITION (dt = '20260507')
SELECT
MAX(systemname) AS system_belong,
MAX(dwproductname) AS category_name,
MAX(dwappgroup) AS dw_appgroup,
MAX(cityid) AS city_id,
MAX(iset) AS cluster_set,
topic,
MAX(data_size) AS ... | system_belong,category_name,dw_appgroup,city_id,cluster_set,topic,total_data_size_d,total_cost,in_charge,dt
SystemAlpha,数据仓库DWProdA,AppGroupX,101,ClusterA,topic_billing,2560000,162.0,user_zhang,20260507
SystemBeta,数据仓库DWProdB,AppGroupY,202,ClusterB,topic_log,1200000,81.0,user_li,20260507
SystemGamma,数据仓库DWProdC,AppGrou... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数(5) + 列名匹配(5)
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_field_value_match,field_value_match,25,非key字段逐列值匹配率
D,D_field_completeness,field_completeness,15,关键字段非空/非空串比例
F,F_insert_overwrite,insert_overwrite,5... | tasks/offline-compute/HiveSQL/hivesql_006_en |
hivesql_007_en | offline-compute_HiveSQL_hivesql_007 | Aggregate Notebook instance runtime statistics by trace_id and p_date for the day: Input table w | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective: Aggregate Notebook instance runtime statistics grouped by `trace_id` and `p_date`.
Input: `internal_platform_db.dws_notebook_instance_execute_minute_stat_d_query_engine_019`
- Partition field: `dt` (STRING, format YYYYMMDD)
- Key fields: `trace_id`, `p_date`, `datawd_project_id`, `datawd_task... | INSERT overwrite TABLE internal_platform_db.dws_notebook_instance_execute_stat_d_query_engine_019 PARTITION (dt = '20260507')
SELECT
t1.trace_id,
t1.p_date,
t1.datawd_project_id,
t1.datawd_task_id,
t1.datawd_task_instance_id,
t1.compute_type,
t1.status_code,
t1.instance_run_time,
t1.code_run_time,
t... | trace_id,p_date,datawd_project_id,datawd_task_id,datawd_task_instance_id,compute_type,status_code,instance_run_time,code_run_time,resource_wait_time,code_start_time,code_end_time,instance_start_time,instance_end_time,serving_id,is_permanent,apply_for_gpu_count,code_gpu_count,instance_gpu_util,code_gpu_util,dt
trace_001... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数(5) + 列名匹配(5)
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_field_value_match,field_value_match,25,非key字段逐列值匹配率
D,D_field_completeness,field_completeness,15,关键字段非空/非空串比例
F,F_insert_overwrite,insert_overwrite,5... | tasks/offline-compute/HiveSQL/hivesql_007_en |
hivesql_008_en | offline-compute_HiveSQL_hivesql_008 | Count tasks matching the shuffle_split tuning rule. Input table: internal_platform_db | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective: Count tasks that match the `shuffle_split` tuning rule, producing task-level tuning rule hit results.
Inputs:
- `internal_platform_db.nextgen_platform_dsl_spark_props_fht0_query_engine_021`
- `internal_platform_db.ods_spark_props_extra_query_engine_021`
- `internal_platform_db.deep_tuning_rul... | insert overwrite table internal_platform_db.shuffle_split_tuning_rule_hit_task_info_query_engine_021 partition (databus_imp_date = '20260507')
with spark_props as
(
select
t1.app_id
,max(spark_partition_min) spark_partition_min
,max(spark_partition_max) spark_partition_max
,max(round(ifnull(spark_ta... | usp_task_id,app_id,app_time_usage,tag,dw_appgroup,product_name,shuffle_split,max_shuffle_stage_task_num,shuffle_stage_time,shuffle_stage_task_time_50th,shuffle_stage_task_time_90th,spark_partition_min,spark_partition_max,spark_task_shuffle_size,spark_default_parallelism,spark_sql_shuffle_partitions,spark_shuffle_sort_b... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,20列 + 列名匹配
C,C_row_alignment,row_consistency,10,行数比例 + key覆盖率
D,D_shuffle_logic,shuffle_logic,20,shuffle_split 条件逻辑(CASE WHEN 版本判断)
D,D_deduplication,deduplication,15,ROW_NUMBER 按 usp_task_id 去重
D,D_numeric_values,numeric_valu... | tasks/offline-compute/HiveSQL/hivesql_008_en |
hivesql_009_en | offline-compute_HiveSQL_hivesql_009 | Compute GPU card-hours for task instances within 5-minute windows, joining Pod mapping and task instance configuration, outputting hourly instanc | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective: Compute GPU card-hours for task instances within 5-minute windows, outputting hourly instance-level GPU usage statistics.
Inputs:
- `internal_platform_db.gputj_gpu_info_parsed_query_engine_022`
- `internal_platform_db.dwd_ml_platform_instance_podname_query_engine_022`
- `internal_platform_db.... | INSERT OVERWRITE TABLE internal_platform_db.task_instance_gpu_time_stats_query_engine_022
PARTITION (dt='2026050700')
WITH
-- Step 1: 从GPU监控数据中提取pod运行记录,按分钟去重
pod_run_minutes AS (
SELECT
pod_name,
gpu_name,
FLOOR(CAST(pkg_time AS BIGINT) / 60) * 60 AS minute_timestamp,
FLOOR(CAST(pkg... | instance_uuid,time_5min,host_gpu_num,sum_run_time_m,gpu_hour,gpu_name,pod_count,host_num
inst-uuid-aaa,1767225600,8.0,7.0,0.9333333333333333,A100,2,2.0
inst-uuid-ccc,1767225600,2.0,1.0,0.03333333333333333,A100,1,1.0
inst-uuid-bbb,1767225900,4.0,2.0,0.13333333333333333,V100,1,1.0
inst-uuid-ddd,1767225900,8.0,1.0,0.13333... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,8列 + 列名匹配
C,C_row_alignment,row_consistency,10,行数比例 + key覆盖率
D,D_gpu_hour_calculation,gpu_hour_calculation,30,gpu_hour 核心指标计算正确性
D,D_window_aggregation,window_aggregation,15,"sum_run_time_m, pod_count 等窗口聚合指标"
D,D_gpu_config_l... | tasks/offline-compute/HiveSQL/hivesql_009_en |
hivesql_010 | offline-compute_HiveSQL_hivesql_010 | 从输入表中筛选状态为 killed 的 Notebook runner trace 数据,按天拆分后 | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
1) 任务目标
产出 killed 状态的 Notebook 实例 Pod 运行明细宽表。
2) 输入
- internal_platform_db.gputj_gpu_info_parsed_agg_1min_query_engine_024
- internal_platform_db.notebook_span_info_query_engine_024
- internal_platform_db.dwd_gputj_service_instance_map_query_engine_024
- internal_platform_db.dwd_ml_platform_instance_podname_... | INSERT OVERWRITE TABLE internal_platform_db.dwd_notebook_killed_instance_pod_detail_d_query_engine_024 PARTITION (dt = '20260507')
WITH base_trace AS (
SELECT trace_id
FROM internal_platform_db.notebook_span_info_query_engine_024
WHERE databus_imp_date >= '2026050700'
AND databus_imp_date <= '20260507... | trace_id,datawd_project_id,datawd_task_id,datawd_task_instance_id,compute_type,status_code,instance_run_time,code_run_time,resource_wait_time,code_start_time,code_end_time,instance_start_time,instance_end_time,serving_id,is_permanent,apply_for_gpu_count,pod_name,pkg_agg_time,gpu_util,gpu_count,p_date,dt
trace001,proj1,... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,22列 + 列名匹配
C,C_row_alignment,row_consistency,10,行数比例 + key覆盖率
D,D_time_calculation,time_calculation,25,"instance_run_time, code_run_time 等时间指标"
D,D_cross_day_split,cross_day_split,15,跨天 trace 按天拆分正确性
D,D_gpu_join,gpu_join,15,"... | tasks/offline-compute/HiveSQL/hivesql_010 |
hivesql_011 | offline-compute_HiveSQL_hivesql_011 | 从 notebook_span_info_query_engine_026 和 notebook_engin | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
任务目标:从 Notebook span 信息和 engine 信息关联产出 killed 实例运行明细表。
输入:
- internal_platform_db.notebook_span_info_query_engine_026
- internal_platform_db.notebook_engine_info_query_engine_026
处理规则:
- 两表关联查询,关联条件需基于表结构确定
- 具体过滤条件和字段选择需基于表结构确定
输出要求:
- 输出表:internal_platform_db.dwd_notebook_killed_instance_detail_d_cand_qu... | INSERT overwrite TABLE internal_platform_db.dwd_notebook_killed_instance_detail_d_query_engine_026 PARTITION (dt = '20260507')
WITH base_trace AS (
SELECT trace_id
FROM internal_platform_db.notebook_span_info_query_engine_026
WHERE databus_imp_date >= '2026050700'
AND databus_imp_date <= '2026050700'
... | p_date,trace_id,datawd_project_id,datawd_task_id,datawd_task_instance_id,compute_type,status_code,instance_run_time,code_run_time,resource_wait_time,code_start_time,code_end_time,instance_start_time,instance_end_time,serving_id,is_permanent,apply_for_gpu_count,dt
2025-05-07,T001,P100,TASK001,INST001,ray,2,105,55,50,202... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,18列 + 列名匹配
C,C_row_alignment,row_consistency,10,行数比例 + key覆盖率
D,D_time_calculation,time_calculation,30,"instance_run_time, code_run_time 等时间指标"
D,D_cross_day_split,cross_day_split,15,跨天 trace 按天拆分正确性
D,D_engine_join,engine_joi... | tasks/offline-compute/HiveSQL/hivesql_011 |
hivesql_012_en | offline-compute_HiveSQL_hivesql_012 | From input table internal_platform_db.t_ed_socialbook_qq_high_v2_ta | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective
Filter out specified `tag_id` values from the tag incremental table and write the results to the target table.
Input
- `internal_platform_db.t_ed_socialbook_qq_high_v2_tag_guid_incr_query_engine_100`
Processing Rules
1. Filter condition: `ds = 20260608` AND `tag_id NOT IN (10212021124, 106060... | insert overwrite table internal_platform_db.t_ed_socialbook_qq_high_v2_tag_guid_incr_filter_query_engine_100 partition(ds=20260608)
select
guid,
tag_id,
tag_value,
redis_sub_key,
val_type,
splitter1,
splitter2,
limit_size,
tag_status
fro... | guid,tag_id,tag_value,redis_sub_key,val_type,splitter1,splitter2,limit_size,tag_status,ds
guid001,10212021100,val1,sub1,type1,:,",",10,1,20260608
guid005,10212021199,val5,sub5,type1,:,",",8,3,20260608 | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数(5) + 列名匹配(5)
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_field_value_match,field_value_match,25,非key字段逐列值匹配率
D,D_field_completeness,field_completeness,15,关键字段非空/非空串比例
F,F_insert_overwrite,insert_overwrite,5... | tasks/offline-compute/HiveSQL/hivesql_012_en |
hivesql_013 | offline-compute_HiveSQL_hivesql_013 | 从 internal_platform_db.dws_ug_app_ad_material_actio | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
任务目标:统计广告素材在各维度下的行为指标汇总,并生成一条更新日期记录。
输入:
- internal_platform_db.dws_ug_app_ad_material_action_di_query_engine_101
处理规则:
- 无 Join,单表处理
- 过滤条件:imp_date = 20260608
- 维度字段转换(使用 CASE WHEN):
- material_type: 1→'图片', 2→'视频'
- source: 2→'人工素材', 3→'人机素材', 6→'AI素材'
- video_model_type: 1→'镜头拆分模型(老模型)', 2→'剧情理解模型... | INSERT OVERWRITE TABLE internal_platform_db.ads_ug_app_ad_material_action_di_query_engine_101 PARTITION (imp_date=20260608)
SELECT
20260608 AS update_date
, CASE
WHEN material_type = 1 THEN '图片'
WHEN material_type = 2 THEN '视频'
... | update_date,material_type_name,source_name,video_model_type_name,create_type_name,purpose_name,provider_name,production_cnt,audit_cnt,pass_cnt,push_cnt,imp_cnt,clck_cnt,imp,clck,channel_name,imp_date
20260608,图片,人机素材,镜头拆分模型(老模型),原始剪辑,收入,AI侧,1,1,1,1,1,0,60,8,广告平台G,20260608
20260608,视频,人机素材,剧情理解模型(新模型),高光剪辑,拉活,内部平台D侧,1,1... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数17 + 列名匹配
C,C_row_alignment,row_consistency,15,行数比例 + key覆盖率
D,D_case_when_labels,case_when_labels,20,7个维度标签列逐行匹配
D,D_agg_metrics,agg_metrics,20,8个聚合列按权重匹配
F,F_union_all_sentinel,union_all_sentinel,10,是否存在NULL哨兵行
F,F_insert_... | tasks/offline-compute/HiveSQL/hivesql_013 |
hivesql_014_en | offline-compute_HiveSQL_hivesql_014 | Filter add-friend behavior from internal_platform_db.log_17047_query_engine_102 | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective:
Perform cluster aggregation analysis on add-friend behavior logs to identify malicious clusters, and output statistical metrics for each cluster.
Input:
- `internal_platform_db.log_17047_query_engine_102` (add-friend behavior log table)
Processing Rules:
1. No joins, single-table processing,... | INSERT INTO TABLE internal_platform_db.t_acct_addfri_action_cluster_minutely_query_engine_102 PARTITION(ds=202606090010)
select
appname_,
clientversion_,
scene_,
ticketscene_,
headmd5_,
uinipcountryid_,
uinipprovinceid_,
count(*) as addfri_pv,
count(distinct user_id_) as user_id_cnt,
sum(if(uinhighquality_=0, 1, 0)) as... | appname_,clientversion_,scene_,ticketscene_,headmd5_,uinipcountryid_,uinipprovinceid_,addfri_pv,user_id_cnt,low_quality_cnt,low_quality_rate,user_id_list,hello_content_list,evil_cnt,evil_rate,ds
app_hello_txt,800,1,100,headmd5_abc,86,440000,21,21,21,1.0,"1011,1010,1021,1020,1008,1019,1007,1018,1006,1017,1005,1016,1004,... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数16 + 列名匹配
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_agg_metrics,agg_metrics,40,"6个聚合指标列逐行匹配(addfri_pv,user_id_cnt,low_quality_rate,evil_rate,low_quality_cnt,evil_cnt)"
F,F_insert_overwrite,insert_overwrite... | tasks/offline-compute/HiveSQL/hivesql_014_en |
hivesql_015_en | offline-compute_HiveSQL_hivesql_015 | From internal_platform_db.t_mg_dws_user_tag_preset_241 | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective: Incrementally insert new user records (`user_id`, `loss_day`) into the `ds=20260608` partition of the target table that have not appeared before.
Inputs:
- `internal_platform_db.t_mg_dws_user_tag_preset_24128_query_engine_103` (source table, containing fields such as `ds`, `user_id`, `loss_da... | insert into internal_platform_db.t_mg_dws_user_tag_user_id_once_24128_query_engine_103 (user_id, loss_day)
select user_id,loss_day
from internal_platform_db.t_mg_dws_user_tag_preset_24128_query_engine_103
where
ds = 20260608
and user_id not in (select user_id from internal_platform_db.t_mg_dws_user_tag_user_id_once_24... | user_id,loss_day
user_a,5
user_b,3
user_e,1 | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数匹配 + 列名匹配
C,C_row_alignment,row_consistency,15,行数比例 + key覆盖率
D,D_anti_join,anti_join,25,NOT IN 排除已存在 user_id 的正确性
D,D_value_correctness,value_correctness,20,loss_day 等数值列逐行匹配
F,F_insert_overwrite,insert_mode,5,INSERT INTO(非 ... | tasks/offline-compute/HiveSQL/hivesql_015_en |
hivesql_016 | offline-compute_HiveSQL_hivesql_016 | 从用户活跃日志表统计每日各渠道的活跃用户数 | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
任务目标:统计各渠道的日活跃用户数。
输入:
- internal_platform_db.dwd_user_activity_log_hi_query_engine_104(用户活跃日志表)
处理规则:
1. 过滤条件:imp_date = 20260608
2. 分组维度:channel
3. 聚合指标:COUNT(DISTINCT user_id) AS dau
4. 派生列:imp_date 固定值 20260608
输出要求:
- 字段顺序:imp_date(BIGINT,固定值20260608)、channel(STRING)、dau(BIGINT)
- 按 channel 升序排列
写入要求... | insert overwrite table internal_platform_db.dws_user_daily_active_by_channel_query_engine_104 partition(ds='20260608')
select
20260608 as imp_date
, channel
, count(distinct user_id) as dau
from
internal_platform_db.dwd_user_activity_log_hi_query_engine_104
where
imp_date = 20260608
group by
channel
order by
channel | imp_date,channel,dau,ds
20260608,appstore,3,20260608
20260608,huawei,2,20260608
20260608,oppo,1,20260608
20260608,xiaomi,1,20260608 | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数(4=3数据+1分区) + 列名匹配(5)
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_field_value_match,field_value_match,25,非key字段逐列值匹配率
D,D_field_completeness,field_completeness,15,关键字段非空比例
F,F_insert_overwrite,insert_overwri... | tasks/offline-compute/HiveSQL/hivesql_016 |
hivesql_017 | offline-compute_HiveSQL_hivesql_017 | 从事件表和全量用户表 Join 过滤出 20260608 当天最后登录用户的事件,按 sdk_id | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
任务目标:按 SDK 类型和小时统计活跃用户数。
输入:
- internal_platform_db.dws_event_tracking_ul2l6h5c_events_di_query_engine_114(事件明细表)
- internal_platform_db.dws_event_tracking_ul2l6h5c_all_user_df_query_engine_114(用户维度表)
处理规则:
- Join 条件:e.user_id = u.user_id
- 过滤条件:e.imp_date = 20260608,u.imp_date = 20260608,u.last_login_date ... | INSERT INTO internal_platform_db.ads_event_tracking_ul2l6h5c_user_active_hour_di_query_engine_114
SELECT
20260608 as `imp_date`
, ROW_NUMBER() OVER(ORDER BY e.`sdk_id`, e.`event_time_hour`) as `id`
, e.`sdk_id` as `sdk_id`
, e.`event_time_hour` as `hour`
, COUNT(DISTINCT e.user_id) as `active_users`
FROM
internal_platf... | imp_date,id,sdk_id,hour,active_users
20260608,1,sdk_android,10,2
20260608,2,sdk_ios,11,2 | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数(5) + 列名匹配(5)
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_field_value_match,field_value_match,45,非key字段逐列值匹配率
F,F_insert_overwrite,insert_mode,5,INSERT INTO 写入模式
F,F_source_filter,source_coverage,5,2张源表均被引用
... | tasks/offline-compute/HiveSQL/hivesql_017 |
hivesql_018_en | offline-compute_HiveSQL_hivesql_018 | Compute scores for first-level comments from view records and comment logs. Group by recall_uin + channel_id + fe | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective: Compute the composite score for first-level comments newly added by recalled read users after their first post view, for content heat analysis.
Inputs:
- `internal_platform_db.dws_social_group_content_forum_hot_feed_recall_feed_view_hi_query_engine_122` (view records, filter `imp_hour` within... | insert overwrite table internal_platform_db.dws_social_group_content_forum_hot_feed_recall_comment_score_hi_query_engine_122 partition (imp_hour = 2026060910)
with social_group_feed_view as
(
select
uin as recall_uin
, channel_id
, feed_id
, min(first_view_time) as first_view_time
, max(last_view_time) as last_view_tim... | uin,channel_id,feed_id,comment_id,comment_time,comment_score,normal_comment_like_score,key_author_comment_like_score,key_owner_comment_like_score,normal_comment_reply_score,key_author_comment_reply_score,key_owner_comment_reply_score,avg_normal_comment_reply_score,normal_comment_like_uv,normal_comment_like_cnt,key_auth... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数26 + 列名匹配
C,C_row_alignment,row_consistency,10,"行数比例 + key(uin,channel_id,feed_id,comment_id)覆盖率"
D,D_comment_score_correctness,comment_score_correctness,25,comment_score + 7项分档评分列逐行匹配
D,D_uv_cnt_correctness,uv_cnt_correctne... | tasks/offline-compute/HiveSQL/hivesql_018_en |
hivesql_019_en | offline-compute_HiveSQL_hivesql_019 | From input table internal_platform_db.t_app_urlsafe_cont_topweb | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective: Extract qualifying potential risk domains from the top websites collection table and write them to the target table.
Input:
- `internal_platform_db.t_app_urlsafe_cont_topwebsites_collect_df_query_engine_125` (fields: `domain`, `site`, `ds`, `src`)
Processing Rules:
1. Filter condition: `src=... | INSERT OVERWRITE TABLE internal_platform_db.t_dws_urlsafe_cont_potential_risk_domain_di_query_engine_125
with topsites as
(
select domain as original_domain
from internal_platform_db.t_app_urlsafe_cont_topwebsites_collect_df_query_engine_125
where src='transco'
and ds=20260608
and length(split(domain, '\\.')[0])>3
limi... | ds,type,fuzzer,result_domain,original_domain
20260608,transco,-1,-1,long-domain-name.org
20260608,transco,-1,-1,test.site.net
20260608,transco,-1,-1,abcd.domain.cn | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,col_count(5) + col_names(5)
C,C_row_alignment,row_consistency,15,row_ratio(7) + key_coverage(8)
D,D_domain_filter_correct,domain_filter_correct,25,original_domain 列值匹配率(核心过滤逻辑)
D,D_fixed_value_correct,fixed_value_correct,20,ds... | tasks/offline-compute/HiveSQL/hivesql_019_en |
hivesql_020 | offline-compute_HiveSQL_hivesql_020 | 从 internal_platform_db.t_boss_v1_dict_item_hour_query_engine_130 筛选 | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
任务目标:对指定分区的字典项小时表进行记录数监控统计,输出监控结果到目标表分区。
输入:
- internal_platform_db.t_boss_v1_dict_item_hour_query_engine_130
处理规则:
1. 无 Join,单表处理
2. 过滤条件:imp_hour=2026060910
3. 分组聚合:按 dim_name='AEGIS_ALL' 和 dim_value='AEGIS_ALL' 分组
4. 聚合计算:count(1) 得到 compute_item_51323
5. 派生列:
- imp_time = 2026060910
- data_type = ... | INSERT OVERWRITE TABLE internal_platform_db.t_boss_v1_dict_item_hour_monitor_res_query_engine_130 PARTITION (p_2026060910='p_2026060910', p_monitor='p_monitor')
SELECT imp_time, data_type, data_id, check_rule_id, check_item_id, dim_name, dim_value, compute_value, compare_value, check_value
FROM (
WITH temp_table_1 AS... | imp_time,data_type,data_id,check_rule_id,check_item_id,dim_name,dim_value,compute_value,compare_value,check_value,p_2026060910,p_monitor
2026060910,monitor,1::dept_om::t_boss_v1_dict_item_hour,51322,51323,AEGIS_ALL,AEGIS_ALL,3,,3,p_2026060910,p_monitor | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数(12=10数据+2分区) + 列名匹配(5)
C,C_row_alignment,row_consistency,15,行数比例(7) + key覆盖率(8)
D,D_field_value_match,field_value_match,45,非key字段逐列值匹配率
F,F_insert_overwrite,insert_overwrite,5,INSERT OVERWRITE + PARTITION 写入模式
F,F_partition... | tasks/offline-compute/HiveSQL/hivesql_020 |
hivesql_021_en | offline-compute_HiveSQL_hivesql_021 | Filter Chinese add-friend content from log table and write to hourly cluster table | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
### Task Objective
Filter Chinese content from the add-friend log table for the specified hour, deduplicate, and write to the hourly cluster table.
### Input
- `internal_platform_db.log_17047_query_engine_131`
### Processing Rules
1. No joins, single-table processing
2. Filter conditions:
- `day_ = '2026... | INSERT INTO TABLE internal_platform_db.data_team_member14_addcontent_cluster_hour_query_engine_131 PARTITION(ds='2026060914')
select distinct content_
from internal_platform_db.log_17047_query_engine_131
where day_='2026-06-09 00:00:00' and hour_ = '2026-06-09 14:00:00'
and commfrinum_=0
and appname_ in ('app_hello_txt... | content_
加好友一起聊天交流分享
你好我想加你好友认识
这是一个测试内容信息 | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数2(含分区列ds) + 列名匹配
C,C_row_alignment,row_consistency,15,行数比例(7) + key(content_)覆盖率(8)
D,D_values,values,40,content_列值集合匹配率
F,F_insert_overwrite,insert_overwrite,5,写入模式应为 INSERT INTO
F,F_partition_value,partition_value,5,ds='20... | tasks/offline-compute/HiveSQL/hivesql_021_en |
hivesql_022 | offline-compute_HiveSQL_hivesql_022 | 从 internal_platform_db.log_16159_query_engine_134 表中提取审核数据,过滤 ds=202 | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
任务目标:将日志表中符合特定条件的审核记录解析并转码,生成包含标签名称的可读审核结果表。
输入:
- internal_platform_db.log_16159_query_engine_134(包含审核日志字段:ds, functype_, actiontype_, othercol1_, resultinfo_, auditid_, operator_, strategyid_, orderid_, providerid_, uniqueauditid_, audittime_, createtime_, receivetime_, queue_label_)
处理规则:
1. 过滤条件:ds=2026... | insert overwrite table internal_platform_db.dwmid_daily_ecommerce_shop_level_func_2141_audit_result_query_engine_134 partition(ds ='2026060916')
with audit_result as
(
select 2026060916 ds,regexp_extract(othercol1_,'bizuin:(.*?);')bizuin,
regexp_extract(othercol1_,'nickname:(.*?);')nickname,
split(regexp_extract(result... | bizuin,nickname,account_tag1,account_tag2,account_tag3,account_tag1_string,account_tag2_string,account_tag3_string,remark,auditid_,operator_,strategyid_,orderid_,providerid_,uniqueauditid_,audittime,createtime_,receivetime_,queue_label_,ds
biz002,shop_B,8001,6001,5002,商品品类杂糅,引人不适(严重),违法违禁,another_remark,5002,op_user2,1... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数20 + 列名匹配
C,C_row_alignment,row_consistency,10,"行数比例 + key(uniqueauditid_,strategyid_,orderid_,providerid_)覆盖率"
D,D_regex_extraction,regex_extraction,20,"正则提取字段逐行匹配(bizuin,nickname,account_tag1/2/3,remark)"
D,D_account_tag_m... | tasks/offline-compute/HiveSQL/hivesql_022 |
hivesql_023_en | offline-compute_HiveSQL_hivesql_023 | Compute multi-dimensional CUBE aggregation of user open-start-path data by referer_type, referer, and path | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective: Compute multi-dimensional aggregation metrics from the user open-start-path detail table, outputting UV and first-time UV across three dimension combinations: application category (`referer_type`), source application (`referer`), and launch path (`path`).
Inputs:
- `internal_platform_db.t_ed_... | insert overwrite table internal_platform_db.t_md_mapservice_user_open_start_path_dwa_di_query_engine_135 partition(ds=20260608)
with t as (
select
event_time,platform,app_version,channel,t1.uin,event_code,event_value,city,brand,device_id_type,bg,event_timestamp,referer,path,is_first
,case when referer in ('com.food... | referer_type,referer,path,uv,first_uv,ds
FoodChainA,com.foodchain_a.android.activity,qqmap://map/routeplan?type=walk,1,1,20260608
CourierCoB,couriercob,qqmap://map/navi,1,0,20260608
CourierCoB,total,total,2,0,20260608
CourierCoB,total,qqmap://map/search,1,0,20260608
CourierCoB,total,qqmap://map/navi,1,0,20260608
Courie... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数6 + 列名匹配
C,C_row_alignment,row_consistency,15,"行数比例 + key(referer_type,referer,path)覆盖率"
D,D_path_clean_referer_map,path_clean_referer_map,25,"路径清洗+referer映射维度值逐行匹配(referer_type,referer,path)"
D,D_cube_aggregation,cube_aggre... | tasks/offline-compute/HiveSQL/hivesql_023_en |
hivesql_024 | offline-compute_HiveSQL_hivesql_024 | 从 internal_platform_db.dwd_relationship_strength_fe | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
任务目标
基于好友关系特征数据计算关系强度推荐分数,输出每个用户对(uin, touin)的加权评分结果。
输入
- internal_platform_db.dwd_relationship_strength_features_v4_di_query_engine_138(无 Join,单表处理)
处理规则
1. 过滤条件:imp_date = 20260608,且 uin >= 10000 且 touin >= 10000
2. 特征处理:
- 对所有分数字段使用 COALESCE(field, 0) 填充空值
- c2c_cnt_score、common_frd_num、frd_tag_nu... | INSERT OVERWRITE TABLE internal_platform_db.ads_qq_sq_frd_recommendation_result_list_df_query_engine_138 PARTITION (imp_date = 20260608)
WITH feature_modified_v2 AS (
SELECT
uin
, touin
, COALESCE(c2c_score, 0) AS c2c_score
, COALESCE(LOG(1 + c2c_cnt_score), 0) AS log_c2c_cnt_score
, COALESCE(socialzone_visit_score, 0... | uin,touin,score,raw_score
10009,10010,570.0,0.0569
10001,10002,307.0,0.0306
10003,10004,238.0,0.0237
10007,10008,31.0,0.003 | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数5 + 列名匹配
C,C_row_alignment,row_consistency,15,"行数比例 + key(uin,touin)覆盖率"
D,D_score_correctness,score_correctness,25,最终得分列逐行匹配
D,D_raw_score_correctness,raw_score_correctness,20,原始分列逐行匹配
F,F_null_handling,null_handling,5,COAL... | tasks/offline-compute/HiveSQL/hivesql_024 |
hivesql_025 | offline-compute_HiveSQL_hivesql_025 | 任务:将两个商品数据源(精细采集和泛化采集)合并,对每个字段生成质量评分。输入表:ads_sec_ec_su | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 600 | ## Prompt
任务目标:将两个商品数据源(精细采集表 hi 和泛化采集表 extensive)按日期分区过滤后 UNION ALL 合并,对合并后的每条记录的每个字段生成质量评分(0/1),输出到评分结果表。
输入:
- internal_platform_db.ads_sec_ec_sup_ec_tele_item_hi_query_engine_140(精细采集表,小时分区 p_hour)
- internal_platform_db.ads_sec_ec_sup_ec_tele_security_platform_lk_extensive_item_query_engine_140(泛化采集表,日分区 p_date)
... | insert overwrite table internal_platform_db.ads_sec_ec_sup_ec_tele_item_score_query_engine_140 partition(p_date='20260608')
with view_union as (
select uniqu_id,
id,
name,
sub_title,
property,
sku_list,
desc_info,
url,
status,
sale_price,
sale_qty,
stock_qty,
main_image_url,
sub_image_url,
category_level1_id,
category_... | uniqu_id,id_socre,name_socre,sub_title_socre,property_socre,sku_list_socre,desc_info_socre,url_socre,status_socre,price_socre,sale_qty_socre,stock_qty_socre,main_image_url_socre,sub_image_url_socre,category_level1_id_socre,category_level1_name_socre,category_level2_id_socre,category_level2_name_socre,category_level3_id... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数87 + 列名匹配
C,C_row_alignment,row_consistency,10,行数比例 + key(uniqu_id)覆盖率
D,D_score_fields,score_fields,25,~80个0/1评分字段逐行正确率(均分)
D,D_derived_flags,derived_flags,20,is_exp和is_off_shelf派生逻辑逐行正确率
D,D_union_source,union_source,10,so... | tasks/offline-compute/HiveSQL/hivesql_025 |
hivesql_026_en | offline-compute_HiveSQL_hivesql_026 | Merge 6 business detail tables from different scenarios (group, pd, socialzone, social_scene, profile_page, group | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## 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_142`
- `internal_platform_db.dwd_im_ad... | INSERT OVERWRITE TABLE internal_platform_db.dwd_im_ads_businesses_core_scene_detail_di_query_engine_142 PARTITION (imp_date = 20260608)
select appid, message_id, puin, code, group_no, scene, sub_scene, hit_msg, is_punish_beat, new_reg_tag, payload_req, reg_date
from internal_platform_db.dwd_im_ads_businesses_core_scene... | appid,message_id,puin,code,group_no,scene,sub_scene,hit_msg,is_punish_beat,new_reg_tag,payload_req,reg_date,imp_date
app001,msg_g1,puin001,1,grp001,scene_group,sub_group1,hit1,1,3,"{""key"":""val1""}",20250101,20260608
app006,msg_jb1,puin006,0,grp006,scene_social_scene,sub_jb1,,0,15,"{""key"":""val6""}",20220601,202606... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数13 + 列名匹配
C,C_row_alignment,row_consistency,15,"行数比例(7) + key(appid,message_id,imp_date)覆盖率(8)"
D,D_row_values,row_values,40,"10个非key数据列逐行匹配(puin,code,group_no,scene,sub_scene,hit_msg,is_punish_beat,new_reg_tag,payload_req,r... | tasks/offline-compute/HiveSQL/hivesql_026_en |
hivesql_027 | offline-compute_HiveSQL_hivesql_027 | 从 dim_ds_org_info_d_ql_query_engine_143(机构信息)、dim_ds_project_info_d | offline-compute | HiveSQL | offline-compute/HiveSQL | zh | pure-text | 900 | ## Prompt
1) 任务目标
构建数字化工具平台数据日报,按日期+平台维度汇总机构、项目、用户、转账四类指标的累计值和新增值,用于平台运营分析。
2) 输入
- internal_platform_db.dim_ds_org_info_d_ql_query_engine_143:机构信息(分区 imp_date=20260608,is_test_org=0)
- internal_platform_db.dim_ds_project_info_d_ql_query_engine_143:项目信息(分区 imp_date=20260608,is_test_project=0)
- internal_platform_db.di... | INSERT INTO TABLE internal_platform_db.ads_gy_digital_tool_used_plat_data_d_ql_query_engine_143
(
imp_date
,`fundraising_platform`
,`stat_date`
,`total_org_cnt`
,`total_pid_org_cnt`
,`total_pid_cnt`
,`total_user_org_cnt`
,`total_user_pid_cnt`
,`total_user_cnt`
,`total_agent_cnt`
,`total_platformw_auth_user_cnt`
,`total... | imp_date,fundraising_platform,stat_date,total_org_cnt,total_pid_org_cnt,total_pid_cnt,total_user_org_cnt,total_user_pid_cnt,total_user_cnt,total_agent_cnt,total_platformw_auth_user_cnt,total_bank_auth_user_cnt,total_transfer_amount,total_platformw_transfer_amount,total_bank_transfer_amount,total_transfer_cnt,total_plat... | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,10,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数51 + 列名匹配
C,C_row_alignment,row_consistency,10,"行数比例 + key(fundraising_platform,stat_date)覆盖率"
D,D_cumulative_metrics,cumulative_metrics,30,26个total_*列逐行匹配
D,D_incremental_metrics,incremental_metrics,25,26个new_*列逐行匹配
F,F_pla... | tasks/offline-compute/HiveSQL/hivesql_027 |
hivesql_028_en | offline-compute_HiveSQL_hivesql_028 | From input table internal_platform_db.t_eis_feedaggregator2_feedforredd | offline-compute | HiveSQL | offline-compute/HiveSQL | en | pure-text | 600 | ## Prompt
Task Objective: Extract qualifying records from the input table, parse the JSON array, and explode it into multiple rows, then output to the target table.
Input:
- `internal_platform_db.t_eis_feedaggregator2_feedforreddot_check_result_summary_classification_df_query_engine_152`
Processing Rules:
1. Filter c... | INSERT OVERWRITE TABLE internal_platform_db.dws_rd_feedaggregator_feed_title_quality_di_query_engine_152 PARTITION (ds = '20260608')
WITH tbl AS (
SELECT
feedid,
type_source,
classification,
second_status,
get_json_object(json_buffer_, '$.info.titles') AS titles_info
FROM internal_platform_db.t_eis_feedaggregator2_feed... | feedid,feedid_v1,type_source,classification,title,title_type,quality,second_status,ds
feed001,feed001,1,classA,Hello World,ocr,high,1,20260608
feed001,feed001,1,classA,Second Title,asr,medium,1,20260608
feed002,feed002,2,classB,Good Morning,manual,low,2,20260608 | 维度,维度全名,子维度,满分,说明
A,A_executability,executability,15,result.sql 能跑通且产出非空
B,B_schema,schema,10,列数9 + 列名匹配
C,C_row_alignment,row_consistency,15,"行数比例 + key(feedid,title)覆盖率"
D,D_explode_correctness,explode_correctness,25,LATERAL VIEW展开行正确性(feedid+title组合匹配)
D,D_json_field_values,json_field_values,20,title_type/quality等JS... | tasks/offline-compute/HiveSQL/hivesql_028_en |
mysql_001 | offline-compute_MySQL_mysql_001 | 实时广告RPM数据过滤与列重命名 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
我需要你生成一段 MySQL 代码,从实时广告 RPM 数据中筛选出指定分钟批次的记录,并对输出列进行重命名。
**业务背景与目标**:广告系统定时将各子任务的 RPM 上报数据写入实时汇总表。下游消费方只需要 `imp_min = 202606090450` 这一批次的记录,并要求输出字段名称与下游表约定一致。本任务将输入表中满足条件的记录筛选出来,同时将 `expose_pv` 重命名为 `total_expose_pv`、`click_pv` 重命名为 `total_click_pv`,写入输出表。
**输入表(全名 + 简要描述)**:
- `internal_platform_db.t_ad_rea... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_001 ground truth: 实时广告RPM数据过滤与列重命名
Task:
Filter input table WHERE imp_min = 202606090450,
rename expose_pv -> total_expose_pv, click_pv -> total_click_pv,
write to output table.
"""
import pymysql
import sys
DB_NAME = "internal_platform_db"
INPUT_TABLE = ... | tasks/offline-compute/MySQL/mysql_001 | ||
mysql_002_en | offline-compute_MySQL_mysql_002 | Inference Service Replica Forecast and Bias Coefficient Computation | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
I need you to generate a MySQL script that, for inference services with autoscaling enabled, expands hourly expected pod counts to 10-minute granularity, clips them using configured upper and lower bounds, computes a bias correction coefficient based on the actual pod count over the past 24 hours, and labels ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_002 ground truth: 推理服务副本数预估与偏差系数计算
Task:
For services with HPA/AHPA enabled, expand hourly expected pod counts to
10-minute granularity, clamp with HPA/AHPA replica limits (× host_num),
compute bias coefficient (actual / clamped p90), and mark AHPA status.... | tasks/offline-compute/MySQL/mysql_002_en | ||
mysql_003 | offline-compute_MySQL_mysql_003 | 离线推理任务特征宽表构建 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
我需要你生成一段 MySQL 代码,创建离线推理任务特征宽表,汇总dt='2026050700'分区内非终态或近期结束的静态模型JOB类型推理任务的特征信息,包含任务基本信息、各阶段耗时、数据集处理情况、实例排队等待时长、提交人和镜像版本。
**输入**:
1. `internal_platform_db.aide_offline_inference_info_fixed_mysql_003`(主表,按dt字段分区过滤)
2. `internal_platform_db.aide_offline_inference_dataset_info_h_mysql_003`
3. `internal_platform_... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_003 ground truth: 离线推理任务特征宽表构建
Task:
Build an offline inference task feature wide table by joining 7 input tables,
aggregating pipeline timing and wait time stats, extracting model info via JSON,
and writing to the output table.
WHERE conditions match t... | tasks/offline-compute/MySQL/mysql_003 | ||
mysql_004_en | offline-compute_MySQL_mysql_004 | Ceph Path Coldness Score Cluster-Level Statistics | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
Please generate MySQL code based on the following requirements.
1. Task Objective
Perform cluster-level statistics on Ceph path coldness score data using three aggregation methods, and write the results to the target table.
2. Input
- Input table: `internal_platform_db.t_ceph_path_coldness_score_v2_mysql_00... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_004 ground truth: Ceph路径冷热评分集群级统计
Task:
对 t_ceph_path_coldness_score_v2_mysql_004 进行三种聚合方式统计,
结果写入 t_ceph_coldness_cluster_stats_v2_cand_mysql_004
"""
import pymysql
import sys
DB_NAME = "internal_platform_db"
INPUT_TABLE = "t_ceph_path_coldness_score_v2_my... | tasks/offline-compute/MySQL/mysql_004_en | ||
mysql_005_en | offline-compute_MySQL_mysql_005 | GPU Inference Platform P90 Traffic Forecast (Holiday/Workday Differentiation) | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
I need you to generate a MySQL script that produces 14-day traffic and resource usage forecasts (P90 percentile) for each service on the GPU inference platform, differentiating between holidays and workdays, with mutual fallback when historical samples are insufficient, and outputting results at both 10-minut... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_005 ground truth: GPU推理平台P90流量预估
Task:
Generate P90 predictions for GPU inference platform services
over the next 14 days, distinguishing holidays vs weekdays,
with fallback logic when historical samples are insufficient.
"""
import pymysql
import sys
DB_... | tasks/offline-compute/MySQL/mysql_005_en | ||
mysql_006 | offline-compute_MySQL_mysql_006 | 推理服务流量与资源预测-P90分位数与节假日降级 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
我需要你生成一段 MySQL 代码,以20260507为预测基准日,为所有在线推理服务生成未来14天的流量与资源使用量预测数据。预测采用断点检测(CPD)结果之后的历史数据,区分节假日/工作日类型计算P90分位数,当某类型历史数据不足时降级使用另一类型数据,输出10分钟和小时两种时间粒度的预测结果。
**输入表(全名 + 简要描述)**:
1. `internal_platform_db.dwm_gputj_platform_gpu_base_feature_agg_v2_mysql_006`(历史特征事实表)
2. `internal_platform_db.dwd_aide_inferencev2_don... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_006 ground truth: 推理服务流量与资源预测-P90分位数与节假日降级
Task:
以20260507为预测基准日,为所有在线推理服务生成未来14天的流量与资源使用量预测数据。
预测采用断点检测(CPD)结果之后的历史数据,区分节假日/工作日类型计算P90分位数,
当某类型历史数据不足时降级使用另一类型数据,输出10分钟和小时两种时间粒度的预测结果。
"""
import pymysql
import sys
DB_NAME = "internal_platform_db"
INPUT_TA... | tasks/offline-compute/MySQL/mysql_006 | ||
mysql_007 | offline-compute_MySQL_mysql_007 | 热表治理元数据宽表汇总 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
我需要你生成一段 MySQL 代码,从表治理明细中筛选有热度的正式表,按库名+表名去重汇总治理指标,形成热表元数据宽表。
**业务背景与目标**:数据平台需要从表治理明细表中筛选出有热度(heat > 0)的正式表(排除表名含 'temp' 的临时表和库名含 'test' 的测试库),按 db_name + table_name 分组去重,对其余所有字段取 MAX,形成热表元数据宽表写入输出表。
**输入表(全名 + 简要描述)**:
- `internal_platform_db.ads_gov_cost_table_govern_detail_df_mysql_007`(表治理明细表)
(表结构与字段含... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_007 ground truth: 热表治理元数据宽表汇总
Task:
Filter input table WHERE imp_date = 20260507 AND heat > 0
AND table_name NOT LIKE '%temp%' AND db_name NOT LIKE '%test%',
group by db_name, table_name, take MAX of all other fields,
write to output table with dt = '2... | tasks/offline-compute/MySQL/mysql_007 | ||
mysql_008 | offline-compute_MySQL_mysql_008 | 消费组治理项明细提取 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
任务目标:从消费特征增量表提取近90天有消费量且非 reader 类型的消费组治理项明细。
**输入表**:`internal_platform_db.dws_mq_consumption_feature_d_increase_mysql_008`(消费特征增量表)
(表结构与字段含义请自行连接数据库查询确认)
**处理规则**:
1. 过滤条件:`dt = '20260507'` AND `(total_consume_last_90d <> 0 AND total_consume_last_90d IS NOT NULL)` AND `is_reader = 0`
2. 派生字段:
- `mq_... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_008 ground truth: 消费组治理项明细提取
Task:
Filter input table WHERE dt = '20260507'
AND (total_consume_last_90d <> 0 AND total_consume_last_90d IS NOT NULL)
AND is_reader = 0
Derive mq_full_topic, app_group, consumergroup_incharge,
consumergroup_descript... | tasks/offline-compute/MySQL/mysql_008 | ||
mysql_009_en | offline-compute_MySQL_mysql_009 | 数据总线 Consumer Group Cost Detail Data Aggregation and Column Renaming | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
I need you to generate a MySQL script that summarizes packet count, size, and cost from 数据总线 consumer group cost raw data, grouped by consumer group + business ID + topic, to produce a consumer group cost detail table.
**Business Background and Objective**: 数据总线 periodically writes cost data for each consume... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_009 ground truth: 数据总线消费组成本明细数据聚合与列重命名
Task:
Filter input table WHERE dt = '20260507',
GROUP BY business_id, topic, consumer_group,
MAX() for systemname, dwproductname, dwappgroup, cityid, iset, pkgcnt, tubesize, total_cost, in_charge,
rename columns, wr... | tasks/offline-compute/MySQL/mysql_009_en | ||
mysql_010_en | offline-compute_MySQL_mysql_010 | Table Heat Field Count and Query User Count Statistics with TOP Ranking | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
I need you to generate a MySQL script that retrieves the current day's data from the heat table, counts the number of heat fields queried and the number of querying users per table, and lands the top 10000 rows ranked by heat in descending order.
**Business Background and Objective**: Retrieve the current da... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_010 ground truth: 表热度字段数与查询用户数统计TOP排序
Task:
Filter input table WHERE imp_date = '20260507',
derive column_count (length of JSON array in column_list) and
user_count (length of JSON array in user_list),
sort by heat DESC, column_count DESC, user_count DES... | tasks/offline-compute/MySQL/mysql_010_en | ||
mysql_011_en | offline-compute_MySQL_mysql_011 | Low-Value Task Benefit Aggregation Statistics by Application Group | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
Task Objective: Summarize the current day's actual and estimated benefit metrics for low-value tasks, grouped by planning product, operations product, OBS product, and application group dimensions.
**Business Background and Objective**: Low-value task governance requires summarizing the current day's actual ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_011 ground truth: 低价值任务收益按应用组聚合统计
Task:
Filter input table WHERE dt = '20260507',
GROUP BY plan_product_name, obs_product_name, product_name, dw_appgroup,
SUM all metric fields, write to output table with dt = '20260507'.
"""
import pymysql
import sys
DB_... | tasks/offline-compute/MySQL/mysql_011_en | ||
mysql_012 | offline-compute_MySQL_mysql_012 | Notebook管道任务GPU利用率分钟级统计 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
任务目标:按任务实例+分钟粒度统计 Notebook 管道任务的 GPU 利用率,区分实例整体利用率与代码运行时段利用率。
输入:
- 表:`internal_platform_db.dwd_notebook_instance_pod_detail_d_mysql_012`(Notebook 实例 Pod 明细表)
(表结构与字段含义请自行连接数据库查询确认)
- 过滤条件:`dt = '20260507'`
处理规则:
- 无 Join,单表处理
- 分组:按 `trace_id`, `p_date`, `pkg_agg_time` 分组
- 聚合口径:
- `datawd_project_id` ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_012 ground truth: Notebook 管道任务实例分钟级 GPU 利用率统计
Task:
Filter input table WHERE dt = '20260507',
group by trace_id, p_date, pkg_agg_time,
aggregate MAX/SUM/AVG per the spec,
write to output table.
"""
import pymysql
import sys
DB_NAME = "internal_platform... | tasks/offline-compute/MySQL/mysql_012 | ||
mysql_013_en | offline-compute_MySQL_mysql_013 | Notebook Cross-Day Instance Pod Runtime Detail | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
I need you to generate a MySQL script that splits Notebook runner cross-day instances by day, joins with service instance, Pod, GPU aggregation, and engine information, to produce cross-day instance Pod runtime detail records.
**Business Background and Objective**: Instances in the Notebook runner may run ac... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_013 ground truth: Notebook跨天实例Pod运行明细
Task:
Split Notebook runner cross-day instances by day, join with service instance,
Pod, GPU aggregation and engine info, produce cross-day instance Pod detail.
"""
import pymysql
import sys
DB_NAME = "internal_platform... | tasks/offline-compute/MySQL/mysql_013_en | ||
mysql_014 | offline-compute_MySQL_mysql_014 | Notebook执行实例明细按天拆分与引擎关联 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
我需要你生成一段 MySQL 代码,从 Notebook runner trace 数据中筛选出存在 execute.code 等代码执行 span 的 trace,按天拆分跨天运行记录,计算实例/代码/资源等待时长等指标,关联引擎信息,产出每日执行实例明细表。
**业务背景与目标**:Notebook runner 在运行过程中会产生多个 trace span(如 runner.execute、execute.code、set.permanent.compute 等)。本任务需要筛选出包含代码执行 span 的 trace,对跨天运行的记录按天拆分,计算各 span 类别的运行时长,并左关联引擎信息(serv... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_014 ground truth: Notebook执行实例明细按天拆分与引擎关联
Task:
Filter notebook_span_info for traces with execute.code spans,
split cross-day records, calculate time metrics, left join engine info,
write to output table.
"""
import pymysql
import sys
DB_NAME = "internal_... | tasks/offline-compute/MySQL/mysql_014 | ||
mysql_015_en | offline-compute_MySQL_mysql_015 | Exposure Log First Exposure Time Computation | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
I need you to generate a MySQL script that computes the first exposure time for each advertisement from the exposure log table.
**Business Background and Objective**: The advertising system periodically writes exposure logs into a summary table. Downstream consumers need to compute the first exposure time pe... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_015 ground truth: 曝光日志首次曝光时间计算
Task:
Filter input table WHERE partition_time = 2026060914
AND ad_data_model_version = 3 AND ad_optimization_goal > 0,
group by ad_aid, compute MIN(action_imp_time) as first_time,
format as FROM_UNIXTIME(MIN/1000, '%Y%m%d... | tasks/offline-compute/MySQL/mysql_015_en | ||
mysql_016 | offline-compute_MySQL_mysql_016 | 应用X模型与组织关系小时表全量迁移 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
我需要你生成一段 MySQL 代码,将源表数据全量迁移至目标表,保持数据完整性。
**业务背景与目标**:应用 X 模型与组织关系小时表记录了资产明细与组织架构的关联关系。本任务将输入表中的全量数据迁移至输出表,不做任何过滤、聚合或字段转换。
**输入表(全名 + 简要描述)**:
- `internal_platform_db.t_app_xmodel_and_org_relation_hour_src_mysql_016`(应用X模型与组织关系小时表)
(表结构与字段含义请自行连接数据库查询确认)
**处理规则**:
- 无过滤条件,全量读取
- 无 Join,单表处理
- 无聚合、无去重
- 保留所... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_016 ground truth: 应用X模型与组织关系小时表全量迁移
Task:
Full migration from source table to target table,
no filtering, no transformation, all columns preserved.
"""
import pymysql
import sys
DB_NAME = "internal_platform_db"
INPUT_TABLE = "t_app_xmodel_and_org_relation_h... | tasks/offline-compute/MySQL/mysql_016 | ||
mysql_017 | offline-compute_MySQL_mysql_017 | 新闻曝光数据全量迁移 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
任务目标:将输入表数据同步至输出表,实现表间数据迁移。
输入:
- `internal_platform_db.dwd_news_dt_others_imp_hi_mysql_017`
处理规则:
- 无 Join,单表处理
- 无过滤条件,保留全部记录
- 无聚合操作
- 字段全量映射,保留源表所有字段
输出要求:
- 输出表:`internal_platform_db.dwd_news_dt_others_imp_si_cand_mysql_017`
- 输出字段顺序与输入表一致
- 不去重,保留所有记录
写入要求:
- 写入模式:覆盖写入(先清空目标表再写入)
- 请使用标准 MySQL 语法,不要... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_017 ground truth: 新闻曝光数据全量迁移
Task:
Copy all rows from input table to output table (full field mapping, no filter).
"""
import pymysql
import sys
DB_NAME = "internal_platform_db"
INPUT_TABLE = "dwd_news_dt_others_imp_hi_mysql_017"
OUTPUT_TABLE = "dwd_news_dt_o... | tasks/offline-compute/MySQL/mysql_017 | ||
mysql_018_en | offline-compute_MySQL_mysql_018 | URL Safety Detection Multi-Dimensional Access Statistics Report | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
I need you to generate a MySQL script that computes multi-dimensional access statistics from the URL safety detection detail table, producing a URL access statistics report.
**Business Background and Objective**: The URL safety detection system collects URL access records for each `taid` daily. It needs to c... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_018 ground truth: 网址安全检测多维度访问统计报表
Task:
From URL safety detection detail table, compute multi-dimensional
access statistics (UV metrics at taid/url/domain/site/cgi levels),
join with historical partition data, and write single-row result
to output table.... | tasks/offline-compute/MySQL/mysql_018_en | ||
mysql_019 | offline-compute_MySQL_mysql_019 | 传感器事件宽表关联用户组帖子分类圈组维度 | offline-compute | MySQL | offline-compute/MySQL | zh | pure-text | 1,800 | ## Prompt
我需要你生成一段 MySQL 代码,将传感器事件数据关联用户组、帖子、分类和圈组维度,生成帖子事件明细宽表。
**业务背景与目标**:传感器事件明细表记录了用户在社区中的各种行为(浏览帖子、点赞、收藏、评论等)。需要将事件数据与圈组成员关系、帖子信息、分类信息和圈组信息进行关联,生成一张帖子事件明细宽表,供下游分析使用。
**输入表(全名 + 简要描述)**:
- `internal_platform_db.dwd_knowledge_base_sensors_event_di_mysql_019`(传感器事件明细表)
- `internal_platform_db.dwv_knowledge_base_g... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_019 ground truth: 传感器事件宽表关联用户组帖子分类圈组维度
Task:
Join sensor events with groups_users, posts+categories, and groups
to produce a posts event detail wide table.
"""
import pymysql
import sys
DB_NAME = "internal_platform_db"
INPUT_TABLE_SENSORS = "dwd_knowledge_b... | tasks/offline-compute/MySQL/mysql_019 | ||
mysql_020_en | offline-compute_MySQL_mysql_020 | Build Volume-Lift Candidate Ad List | offline-compute | MySQL | offline-compute/MySQL | en | pure-text | 1,800 | ## Prompt
I need you to generate a MySQL script that builds a volume-lift candidate ad list, outputting to table `internal_platform_db.dwm_union_raise_candidate_new_ads_hf_cand_mysql_020` with partition key `p_partition='2026060905'`.
**Business Background and Objective**: The ad volume-lift system needs to jointly fi... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mysql_020 ground truth: 构建提量候选广告列表
Task:
Build raise-candidate ad list from 7 input tables via multi-table JOIN,
aggregation, window functions, and filtering, write to output table
with p_partition='2026060905'.
"""
import pymysql
import sys
DB_NAME = "internal... | tasks/offline-compute/MySQL/mysql_020_en | ||
prestosql_001 | offline-compute_PrestoSQL_prestosql_001 | 安全扫描实例明细分析 | offline-compute | PrestoSQL | offline-compute/PrestoSQL | zh | pure-text | 900 | ## Prompt
任务目标:从安全扫描 span 信息和资源分配信息关联产出安全扫描实例运行明细表。
输入:
- internal_platform_db.t_security_scan_span_prestosql_001
- internal_platform_db.t_security_resource_info_prestosql_001
处理规则:
- 两表关联查询,关联条件需基于表结构确定
- 具体过滤条件和字段选择需基于表结构确定
输出要求:
- 输出表:internal_platform_db.t_security_scan_instance_detail_cand_prestosql_001
- 输出字段需... | INSERT INTO internal_platform_db.t_security_scan_instance_detail_prestosql_001
WITH base_trace AS (
SELECT trace_id
FROM internal_platform_db.t_security_scan_span_prestosql_001
WHERE databus_imp_date >= '2026060600'
AND databus_imp_date <= '2026060800'
AND span_name IN ('scan.completed', 'scan.f... | tasks/offline-compute/PrestoSQL/prestosql_001 | ||
prestosql_002_en | offline-compute_PrestoSQL_prestosql_002 | Ad ASA Attribution Migration | offline-compute | PrestoSQL | offline-compute/PrestoSQL | en | pure-text | 900 | ## Prompt
**Task Objective**: From the ad attribution raw logs, filter valid records of two attribution types (ad_attribution and huawei), aggregate the log count and deduplicated user count by version and media dimensions, and write the results to the output table.
**Input Table**:
- `internal_platform_db.t_sh_event_... | INSERT OVERWRITE TABLE internal_platform_db.t_my_ads_tracking_log_metrics_prestosql_002
SELECT
CAST(ds AS BIGINT) AS ds,
ad_version,
CASE ad_version WHEN 'ad_attribution' THEN 39 WHEN 'phonebrandh' THEN 28 END AS media_id,
COUNT(*) AS log_num,
COUNT(DISTINCT device_id) AS log_num_qimei
FROM internal_platform_... | tasks/offline-compute/PrestoSQL/prestosql_002_en | ||
prestosql_003 | offline-compute_PrestoSQL_prestosql_003 | IM平台Q群离线报告子分区过滤 | offline-compute | PrestoSQL | offline-compute/PrestoSQL | zh | pure-text | 900 | ## Prompt
**任务目标**:从IM平台Q群离线报告原始日志中,筛选指定appid下包含"诈骗"标签的记录,提取关键字段写入输出表。
**输入表**:
- `internal_platform_db.dwd_t_event_log_v1_05900072467_with_subpartition_hi_prestosql_003`(IM平台Q群离线报告原始日志)
- `databus_imp_date` STRING — 数据日期
- `ftime` STRING — 时间
- `appid` STRING — 应用ID
- `message_id` STRING — 消息ID
- `reqbody` ... | INSERT OVERWRITE TABLE internal_platform_db.dwd_qqgroup_offline_report_prestosql_003
SELECT
ftime,
'101069' AS appid,
'IM平台Qgroup_zhapian_report_1049' AS model_id,
message_id,
databus_imp_date,
group_num,
punish_path_name,
content
FROM internal_platform_db.dwd_t_event_log_v1_05900072467_with_subpartitio... | tasks/offline-compute/PrestoSQL/prestosql_003 | ||
prestosql_004 | offline-compute_PrestoSQL_prestosql_004 | 小说UDS算法书籍关系筛选 | offline-compute | PrestoSQL | offline-compute/PrestoSQL | zh | pure-text | 900 | ## Prompt
**任务目标**:从小说UDS算法书籍关系表中,筛选指定事件类型的记录,根据事件类型映射为操作类型,提取关键字段写入输出表。
**输入表**:
- `internal_platform_db.t_oh_novel_uds_algorithm_book_rel_prestosql_004`(小说UDS算法书籍关系表)
- `ftime` STRING — 时间
- `event_code` STRING — 事件编码
- `book_id` STRING — 书籍ID
- `guid` STRING — 用户标识
- `reqid` STRING — 请求ID
- `traceid` ST... | INSERT OVERWRITE TABLE internal_platform_db.t_od_novel_user_action_detail_prestosql_004
SELECT
reqid,
guid,
book_id AS bookid,
substr(traceid, 1, 4) AS traceid,
CASE event_code
WHEN 'expose' THEN 'expose'
WHEN 'click' THEN 'click'
WHEN 'real_read' THEN 'real_read'
WHEN 'add_0' THEN 'add_0'
... | tasks/offline-compute/PrestoSQL/prestosql_004 | ||
prestosql_005_en | offline-compute_PrestoSQL_prestosql_005 | Hot Table Governance Metadata Wide Table Aggregation | offline-compute | PrestoSQL | offline-compute/PrestoSQL | en | pure-text | 900 | ## Prompt
**Task Objective**: From the hot table governance metadata detail table, filter valid hot table records (heat > 0, excluding temporary/test tables), aggregate by database name and table name to take the maximum of each metric, and write the results to the output table.
**Input Table**:
- `internal_platform_d... | INSERT OVERWRITE TABLE internal_platform_db.dwd_hot_metadata_table_prestosql_005
SELECT
'20260507' AS dt,
db_name,
table_name,
MAX(owner) AS owner,
MAX(storage_detail) AS storage_detail,
MAX(heat) AS heat,
MAX(task_cnt) AS task_cnt,
MAX(table_type) AS table_type,
MAX(govern_status) AS govern_status,
... | tasks/offline-compute/PrestoSQL/prestosql_005_en | ||
prestosql_006_en | offline-compute_PrestoSQL_prestosql_006 | News Plugin Send Process Multi-Dimensional Aggregation | offline-compute | PrestoSQL | offline-compute/PrestoSQL | en | pure-text | 900 | ## Prompt
**Task Objective**: From the news plugin send process flow table, aggregate and compute metrics such as send count, send UV, panel exposure count, panel exposure UV, inner-page PV, and inner-page UV by the scene (`pos_desc`) dimension, across two time windows — current day and last 1 hour — and write the resu... | INSERT OVERWRITE TABLE internal_platform_db.ads_news_plugin_ai_assistant_hourly_report_prestosql_006
SELECT
h.imp_hour,
h.pos_desc AS scene,
h.send_cnt_dth,
h.send_uv_dth,
h.panel_exp_cnt_dth,
h.panel_exp_uv_dth,
h.pgin_pv_dth,
h.pgin_uv_dth,
h.send_cnt_1h,
h.send_uv_1h,
h.panel_exp_cnt_1h,
h.pa... | tasks/offline-compute/PrestoSQL/prestosql_006_en | ||
prestosql_007_en | offline-compute_PrestoSQL_prestosql_007 | APK Threat Scan Instance GPU Card-Hour 5-Minute Window Statistics | offline-compute | PrestoSQL | offline-compute/PrestoSQL | en | pure-text | 900 | ## Prompt
**Task Objective**: Compute the GPU card-hour consumption of APK scan instances, aggregated by 5-minute time windows, joining with Pod mapping and task instance GPU configuration information, and write the results to the output table.
**Input Tables**:
- `internal_platform_db.t_gpu_monitor_parsed_prestosql_0... | INSERT INTO internal_platform_db.t_scan_instance_gpu_time_stats_prestosql_007
WITH
-- Step 1: From GPU monitoring data, extract pod run records with minute-level dedup
pod_run_minutes AS (
SELECT
pod_name,
gpu_name,
FLOOR(CAST(pkg_time AS BIGINT) / 60) * 60 AS minute_timestamp,
FLOOR... | tasks/offline-compute/PrestoSQL/prestosql_007_en | ||
prestosql_008_en | offline-compute_PrestoSQL_prestosql_008 | Report WUID Detail Filtering | offline-compute | PrestoSQL | offline-compute/PrestoSQL | en | pure-text | 900 | ## Prompt
**Task Objective**: From the ad report WUID detail wide table, filter target ad delivery records based on multi-dimensional filter conditions, extract key fields, and write the results to the output table.
**Input Table**:
- `internal_platform_db.t_report_wuid_detail_d_prestosql_008` (report WUID detail tabl... | INSERT OVERWRITE TABLE internal_platform_db.sdk_sample_pay_neg_mini_prestosql_008
SELECT
wuid,
product_id,
adgroup_id,
action_time,
crm_id,
creative_id,
label,
product_type,
optimization_goal,
roi_goal,
partition_time
FROM internal_platform_db.t_report_wuid_detail_d_prestosql_008
WHERE partition_t... | tasks/offline-compute/PrestoSQL/prestosql_008_en | ||
prestosql_009 | offline-compute_PrestoSQL_prestosql_009 | Data Pipeline Killed Instance Analysis | offline-compute | PrestoSQL | offline-compute/PrestoSQL | zh | pure-text | 900 | ## Prompt
Join pipeline span info and resource info tables to produce killed instance detail table. Specific filtering conditions and field selection need to be determined based on table structure.
**输入表**:
- `internal_platform_db.t_pipeline_span_info_prestosql_009`(Pipeline span信息表)
- `databus_imp_date` STRING — 日期... | INSERT INTO internal_platform_db.t_pipeline_killed_instance_detail_prestosql_009
WITH base_trace AS (
SELECT trace_id
FROM internal_platform_db.t_pipeline_span_info_prestosql_009
WHERE databus_imp_date = '20260608'
AND span_name IN ('pipeline.execute', 'pipeline.killed')
GROUP BY trace_id
HAVI... | tasks/offline-compute/PrestoSQL/prestosql_009 | ||
prestosql_010 | offline-compute_PrestoSQL_prestosql_010 | IOC MTTD指标计算 | offline-compute | PrestoSQL | offline-compute/PrestoSQL | zh | pure-text | 900 | ## Prompt
**任务目标**:从API指标表和威胁情报IOC表中,通过JSON解析提取IOC值,与IOC表关联计算MTTD(平均检测时间)指标,写入输出表。
**输入表**:
- `internal_platform_db.t_app_ti_entity_api_metrics_prod_hi_prestosql_010`(API指标表)
- `timestamp` BIGINT — 时间戳
- `username` STRING — 用户名
- `appid` BIGINT — 应用ID
- `path` STRING — 路径
- `request` STRING — 请求体(JSON)
- `... | INSERT OVERWRITE TABLE internal_platform_db.t_app_breaking_ti_mttd_metric_prestosql_010
WITH api_metrics AS (
SELECT
get_json_object(request, '$.entity_value') AS ioc_value,
MIN(`timestamp`) AS earliest_timestamp
FROM internal_platform_db.t_app_ti_entity_api_metrics_prod_hi_prestosql_010
WHERE ds = 202606... | tasks/offline-compute/PrestoSQL/prestosql_010 | ||
prestosql_011 | offline-compute_PrestoSQL_prestosql_011 | 安全平台PG敏感接口2表UNION+聚合 | offline-compute | PrestoSQL | offline-compute/PrestoSQL | zh | pure-text | 900 | ## Prompt
**任务目标**:将两个安全平台PG敏感接口数据表合并,排除黑名单域名后,按日期、域名和接口路径聚合,将匹配规则名拼接为逗号分隔字符串,写入输出表。
**输入表**:(2个表结构相同)
- `internal_platform_db.internal_sec_radept_secpg_data_result2_prestosql_011`
- `internal_platform_db.internal_sec_radept_secpg_data_result4_prestosql_011`
各表字段:
- `databus_imp_date` INT — 数据日期
- `insert_time` S... | INSERT OVERWRITE TABLE internal_platform_db.secpg_sensitive_interface_prestosql_011
SELECT
databus_imp_date,
http_host,
http_cgi,
concat_ws(',', collect_set(rule_name)) AS con_con
FROM (
SELECT databus_imp_date, http_host, http_cgi, rule_name
FROM internal_platform_db.internal_sec_radept_secpg_data_result2_... | tasks/offline-compute/PrestoSQL/prestosql_011 | ||
prestosql_012_en | offline-compute_PrestoSQL_prestosql_012 | Data Quality Check Pipeline Instance GPU Card-Hour Analysis | offline-compute | PrestoSQL | offline-compute/PrestoSQL | en | pure-text | 900 | ## Prompt
**Task Objective**: Analyze the runtime of data quality check pipeline instances. For some abnormally terminated instances, their completion records need to be backfilled. Compute the runtime duration of each instance per date shard, and combined with GPU monitoring data, compute the GPU card-hour consumption... | INSERT INTO internal_platform_db.t_quality_check_gpu_instance_detail_prestosql_012
WITH base_trace AS (
-- Step 1: Find trace_ids with check.aborted but NOT check.completed (HAVING inverted condition)
SELECT trace_id
FROM internal_platform_db.t_quality_check_span_prestosql_012
WHERE databus_imp_date >= ... | tasks/offline-compute/PrestoSQL/prestosql_012_en | ||
pyspark_001 | offline-compute_PySpark_pyspark_001 | 被动客服满意度归因环比对比 | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,产出"被动客服会话满意度归因因素"的环比对比表。
**业务背景与目标**:被动客服每天都会按 reason / reason_detail / session_type 维度产出一份满意度归因明细(dwd_ww_kf_session_satify_attrib)。运营希望对每一条归因因素同时做两个维度的对比:(1) 与 14 天前同一 reason+reason_detail+session_type 的指标做差值;(2) 与上月相同类型日期(工作日 vs 工作日、周末 vs 周末)的平均指标做差值。本任务把当天、14 天前、上月这三组数据拉齐后,逐条计算满意度差值、占比... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
caseR1: 被动客服满意度归因 - 14天/上月对比 (SparkBase -> SparkSession 改写)
- 沙箱无分区版:原 part_name=last14day / part_name=part_names 改成 WHERE imp_date='...' / WHERE imp_date IN (...)
- 原 self.statdate 硬编码为 '20260513'(沙箱化日期)
- 原 self.save_dw_data 改为 spark.sql INSERT OVERWRITE TABLE
"""
im... | tasks/offline-compute/PySpark/pyspark_001 | ||
pyspark_002 | offline-compute_PySpark_pyspark_002 | 代码review的note diff按天同步到DWV层 | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,按天把代码评审场景下"代码 note 的 diff 文件明细"从 ODS 层同步到 DWV 层。
**业务背景与目标**:上游 databus 每天会落一份当天产生的 note diff 明细到 ods 表(每行 = 一条 note 评论 + 它附带的 diff 文本)。下游 DWV 层希望按 year/month/day 三级日期分区组织,方便日期回溯,且要对一天内出现的重复行(同一个 note id 配同一段 diff 文本)做去重。
**输入表**:
- `internal_platform_db.case5_ods_code_v2_note_diff_files... | #!/usr/bin/env bash
from __future__ import print_function
import re
import sys
import os
import json
import datetime
from pyspark.sql import SparkSession
if __name__ == "__main__":
print('PythonSQL start')
#yyyyMMdd
ds = '20260513' # was: sys.argv[1]
match = re.match(r"([\d]{4})([\d]{2})([\d]{2})"... | tasks/offline-compute/PySpark/pyspark_002 | ||
pyspark_003_en | offline-compute_PySpark_pyspark_003 | Sync Code Review review-diff from ODS to DWV Layer by Day | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
I need you to generate a PySpark script that synchronizes the "code review diff file details" from the ODS layer to the DWV layer by day for the code review scenario.
**Business Background and Objective**: The upstream databus produces a daily review diff detail (one row = one review comment + corresponding ... | # data-mocker rewrite-gt
# source: pyspark_0428_desensitized.jsonl idx=43924
# task_name: dwv_code_v2_review_diff_files_diff_d_f
# rewrite rules:
# 1) dept_t_yg_code.ods_code_v2_review_diff_files_diff_d_f
# -> internal_platform_db.case6_ods_code_v2_review_diff_files_diff_v3
# 2) code.dwv_code_v2_review_diff_f... | tasks/offline-compute/PySpark/pyspark_003_en | ||
pyspark_004 | offline-compute_PySpark_pyspark_004 | 销售线索企业邮品牌明细 | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,产出"销售线索企业邮品牌明细"。
**业务背景与目标**:线下销售团队有一份三非企业的销售线索表(含 corpid 唯一键),数据仓库侧有一份每月统计的邮箱平台画像表(每个 corpid 多行,按 top_domain / domain_isp 维度统计当月被唤醒的不同别名邮箱数量)。运营想要的是:对每一个三非线索企业,把它的活跃邮箱(domain_alias_monthwakeup_uniq >= 1)提取出来,并且把底层细粒度的 domain_isp 字段(如 'cloud_a'、'mail_provider_n'、'biz' 等)映射成业务可识别的标准品牌('电商平... | # project_alpha rewrite-gt
# source: data/v7_gt_codes/case_row08_case_0028.py (v7 row 7, manifest_row 8)
# task_name: t_dwd_ww_tele_sale_corp_domain_mx_copilot
# rewrite rules:
# 1) internal_platform_db.ods_tele_sale_clue_info_mysql_copilot
# -> internal_platform_db.project_alpha_ods_tele_sale_clue_info_mysql_v... | tasks/offline-compute/PySpark/pyspark_004 | ||
pyspark_005_en | offline-compute_PySpark_pyspark_005 | AI Search Parse Quality Daily Detail (case9 version) | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
Business Background: Compute daily details of AI search web page parse quality by site + directory dimensions. Take data from the past few days, aggregate success rate, index page ratio, short content ratio, and failure step counts by the (date_key, host, fld) dimension, and join with the Top500 site priority... | # data-mocker rewrite-gt
# source: 离线计算pyspark例子_v7.xlsx 工作表1 row=10 col=3
# row_idx: 9
# intent_short: 帮我做个AI搜索引擎解析质量的每日明细统计,按站点和目录维度算一下成功率、索引页占比、短内容占比,还有各环节的失败分布。另外需要把Top500站点的优先级标签关联上
# v3 tables: internal_platform_db.ai_engine_classify_parse_result_daily_detail_copilot_v3, internal_platform_db.ai_engine_classify_pa... | tasks/offline-compute/PySpark/pyspark_005_en | ||
pyspark_006_en | offline-compute_PySpark_pyspark_006 | AI Search Parse Quality Daily Detail | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
I need you to generate a PySpark script that produces the "AI Search Parse Quality Daily Detail".
Business Background: Compute daily details of AI search web page parse quality by site + directory dimensions. Take data from the past few days, aggregate success rate, index page ratio, short content ratio, and... | # case10 rewrite-gt
# source: data/v7_gt_codes/case_row10_case_0043.py (v7 row 9, manifest_row 10)
# task_name: ai_engine_classify_parse_result_daily_detail
# rewrite rules:
# 1) internal_platform_db.ai_engine_classify_parse_result_daily_copilot
# -> internal_platform_db.case10_ai_engine_classify_parse_result_d... | tasks/offline-compute/PySpark/pyspark_006_en | ||
pyspark_007_en | offline-compute_PySpark_pyspark_007 | Sync Cloud-Check User Active Status to Application Layer | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
I need you to generate a PySpark script that synchronizes the "user cloud-check active status" detail from ODS to the application layer DWV, and applies compliance encryption to the phone number to generate a unionid.
**Business Background and Objective**: In the upstream ODS, the `phone_enc` field is the bo... | # data-mocker rewrite-gt
# source: v7 xlsx row 16 (case15)
# task_name: t_app_regul_user_comm_security_cloud_active_status_phone_uid_df_copilot
# rewrite rules:
# 1) internal_platform_db.t_app_comm_security_user_cloud_active_status_phone_df_copilot
# -> internal_platform_db.case15_ods_phone_active_df_v3
# 2) ... | tasks/offline-compute/PySpark/pyspark_007_en | ||
pyspark_008_en | offline-compute_PySpark_pyspark_008 | Cleanse API Cloud-Check Logs | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
I need you to generate a PySpark script that cleanses the "API cloud-check log" hourly table from ODS and synchronizes it to the DWD layer.
**Business Background and Objective**: API-SDK cloud-check writes a raw log to ODS every hour (containing the caller's phone number `phonenum`/`phonenum_reg`, device IME... | # data-mocker rewrite-gt
# source: v7 xlsx row 17 (case16)
# task_name: t_dwd_comm_security_user_api_query_mgr_hi_copilot
# rewrite rules:
# 1) internal_platform_db.t_ods_comm_security_user_api_query_mgr_hi_copilot
# -> internal_platform_db.case16_ods_comm_security_user_api_query_mgr_hi_v3
# 2) internal_platf... | tasks/offline-compute/PySpark/pyspark_008_en | ||
pyspark_009_en | offline-compute_PySpark_pyspark_009 | Anti-Spam H5 Work Order Log Daily Detail Sync | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
I need you to generate a PySpark script that synchronizes the "Anti-Spam H5 Work Order Log" from ODS to the DWD detail table with full-field passthrough, and adds a run date column.
**Business Background and Objective**: The anti-spam H5 work order service writes each appeal/report operation log to the raw `... | # caseR18 rewrite-gt
# source: data/v7_gt_codes/case_row19_case_0011.py (v7 row 18, manifest_row 19)
# task_name: t_dwd_ww_log_80001099_daily_copilot
# rewrite rules:
# 1) internal_platform_db.log_80001099_copilot
# -> internal_platform_db.caseR18_ods_log_80001099_v3
# 2) internal_platform_db.dwd_ww_log_80001... | tasks/offline-compute/PySpark/pyspark_009_en | ||
pyspark_010 | offline-compute_PySpark_pyspark_010 | 项目管理工具PM工单变更去重 | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,将 项目管理工具PM 工单变更明细表做去重处理后写入 DWV 层。
**业务背景**:上游 ODS 表 ods_pmtool_v_workitem_changes_df 按 databus_imp_date 分区存储 项目管理工具PM 工单的每次变更记录。同一个工单变更 ID 可能存在多条变更记录(如同一条 id 在不同时间点被多次修改),需要按 id 分组去重,保留最新的 workspace_id/workitem_id/workitem_type_id 等数值字段,以及最早的 creator/created/change_summary 等字符串字段,最终写入 DWV... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pyspark_010: 项目管理工具PM workitem changes DWV - GROUP BY dedup + partition write"""
from pyspark.sql import SparkSession
spark = SparkSession.builder \
.appName('dwv_pmtool_workitem_changes_df') \
.enableHiveSupport() \
.getOrCreate()
ds = '20260513'
ds_year ... | tasks/offline-compute/PySpark/pyspark_010 | ||
pyspark_011_en | offline-compute_PySpark_pyspark_011 | Phone Number Encrypted Prefix Quality Score Statistics | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
I need you to generate a PySpark script that computes a phone number encrypted prefix quality score statistics table.
**Business Background and Objective**: The phone number quality score table stores the quality score (`maochi` field) for each phone number encrypted string. Operations needs to perform aggre... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyspark_011: Phone enc prefix quality score
- Read t_dwd_phone_enc_quality_score_df, filter maochi != -9
- Use substr() to extract phone_enc prefix (first 7 chars) instead of Java UDF IdSubstr
- CTE aggregation per prefix: avg quality_score, evil ratio, white ratio
- LE... | tasks/offline-compute/PySpark/pyspark_011_en | ||
pyspark_012 | offline-compute_PySpark_pyspark_012 | 网页解析结果Top500详情统计 | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,对网页解析结果进行质量统计,产出 Top500 站点的详情日报表。
**业务背景与目标**:每天都会对大量网页进行解析,解析结果记录在 `ai_engine_classify_parse_result_daily` 表中。安全部门需要按站点维度统计解析质量,包括成功/失败解析数、索引页占比、短内容占比、各错误步骤分布等,并与站点优先级信息关联,生成一张按日期和站点粒度的解析质量详情表。
**输入表**:
- `internal_platform_db.sec_app_hy_top_500_sites_tag_v1_pyspark_100`
- `internal_pla... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyspark_012: AI search parse results top500 detail
- 3 input tables: priority_info, daily parse results
- Date range: hardcode today_str='20260513', five_days_ago='20260508'
- Parse content JSON from parse_html field using from_json
- Compute summary stats, index_page_r... | tasks/offline-compute/PySpark/pyspark_012 | ||
pyspark_013 | offline-compute_PySpark_pyspark_013 | 银行XURL安全关系关联 | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,从平台 URL 安全关系中提取银行X相关的贷中和意愿用户样本。
**业务背景与目标**:安全部门维护了一份平台 guid 与 URL 的关系表,记录了用户访问过的 URL 及其 cgi 信息。风控业务需要从这份关系表中筛选出访问过银行X(bankx.com.cn)特定页面的用户,按贷款阶段分为"贷中用户"和"意愿用户"两类,输出到贷款用户样本表中,供下游风控模型使用。
**输入表**:
- `internal_platform_db.t_dwd_urlsafe_rela_guid_url_di_pyspark_101`
**数据范围与过滤条件**:
- 运行日期 ds... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyspark_013: URL safety relation join (银行X)
- 2 input tables: t_dwd_urlsafe_rela_guid_url_di, t_rta_loan_url_samples
- Hardcode: ds='20260513', target_domain='bankx.com.cn', data_source='social'
- Define in_loan_cgi and will_cgis URL patterns for BankX bank
- Build in-l... | tasks/offline-compute/PySpark/pyspark_013 | ||
pyspark_014 | offline-compute_PySpark_pyspark_014 | 过去半年在线过的实验计划信息查询 | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,查询过去半年内上线过的实验计划信息,取每个实验分组的最新一条记录。
**业务背景与目标**:实验平台按小时维度存储了实验计划的上线记录(fdate, exp_group_id, trigger_list)。运营需要从过去 180 天(半年)的历史数据中,按实验分组 exp_group_id 维度取最新的一条记录,输出到结果表中,用于后续的实验分析。
**输入表**:
- `internal_platform_db.exp_hours_input_pyspark_102`
**数据范围与过滤条件**:
- 运行日期 cur_date 固定为 '20260513'
- 历... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyspark_014: Experiment plans past half year query
- 1 input table: exp_hours_input_pyspark_102 (fdate, exp_group_id, trigger_list, partitioned by p_hour)
- Read all partitions from p_2026051300 back to p_2026051300 - 24*180 hours (half year)
- Hardcode: cur_date='20260... | tasks/offline-compute/PySpark/pyspark_014 | ||
pyspark_015 | offline-compute_PySpark_pyspark_015 | 用户标签同步ETL | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,完成"用户标签同步ETL"的数据加工任务。
**业务背景与目标**:安全平台每天从 event_log 日志中采集用户设备与标签数据(t_sh_event_log_v2_xab00014231),数据中包含手机号、IMEI、IMSI、AndroidID 等敏感信息,这些字段在原始日志中已经过在线加密(OnlineCrypt)存储为加密字段。本任务需要将加密字段解密后,使用加密算法重新加密,同时对数据类型字段做 INT 转换,最终写入下游用户标签同步表(t_ods_comm_security_user_tag_sync_hi)供安全分析使用。
**输入表**:
- `in... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyspark_015: 用户标签同步ETL (Java UDF -> sha2 改写)
- 原 pytoolkit/IdCrypt/OnlineCrypt 替换为内置 sha2() 函数
- 原 self.statdate 硬编码为 '20260513'(沙箱化日期)
- 原 self.save_dw_data 改为 spark.sql INSERT OVERWRITE TABLE
"""
from pyspark.sql import SparkSession
spark = (
SparkSession.builde... | tasks/offline-compute/PySpark/pyspark_015 | ||
pyspark_016 | offline-compute_PySpark_pyspark_016 | 代码评审组织排行 | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,产出代码协作平台代码评审(CR)按组织维度的排名表。
**业务背景与目标**:代码协作平台每天都会产生代码评审数据,包括评审注释(line_note)和评审耗时(used_time)。运营希望按公司/部门/中心/小组四级组织维度,对成员进行两个维度的 Top10 排名:(1) 按评审注释数降序排名(notes_create_desc);(2) 按评审投入时间降序排名(cr_used_time_desc)。通过 rank_space 交叉连接生成完整的排名空间,左连接实际数据,产出组织排名明细表。
**输入表**:
- `internal_platform_db.dim_... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyspark_220: 代码协作平台CR组织排名 - Code Review Org Ranking (L3)
- 沙箱化改写:硬编码日期 '20260513',移除 pytoolkit/dateutil 依赖
- 使用 spark.sql() 执行全部 CTE 逻辑
"""
import datetime
from pyspark.sql import SparkSession
spark = (
SparkSession.builder
.appName('pyspark_016_cr_org_rank')
... | tasks/offline-compute/PySpark/pyspark_016 | ||
pyspark_017_en | offline-compute_PySpark_pyspark_017 | Anomaly Detection Analysis | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
I need you to generate a PySpark script that implements anomaly detection analysis based on business data.
**Business Background and Objective**: In the advertising delivery business, operations needs to monitor changes in key metrics (such as `real_cost`) across different industry (`industry_for_business`) ... | #!/usr/bin/env python3
"""pyspark_017 ground truth: anomaly detection analysis (simplified)"""
from pyspark.sql import SparkSession
spark = SparkSession.builder \
.appName('dataclaw_eval_gt_pyspark_017') \
.enableHiveSupport() \
.config('spark.sql.warehouse.dir', '/tmp/hive_warehouse') \
.getOrCreate()... | tasks/offline-compute/PySpark/pyspark_017_en | ||
pyspark_018_en | offline-compute_PySpark_pyspark_018 | SOA Dependency Analysis | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
I need you to generate a PySpark script that implements strong dependency relationship analysis for high-impact modules of use cases, based on the Payment Platform W SOA architecture (SOA Dependency Analysis).
**Business Background and Objective**: In the Payment Platform W SOA architecture, it is necessary ... | #!/usr/bin/env python3
"""pyspark_018 ground truth: SOA dependency analysis"""
import json
from pyspark.sql import SparkSession
spark = SparkSession.builder \
.appName('dataclaw_eval_gt_pyspark_018') \
.enableHiveSupport() \
.config('spark.sql.warehouse.dir', '/tmp/hive_warehouse') \
.getOrCreate()
ds... | tasks/offline-compute/PySpark/pyspark_018_en | ||
pyspark_019_en | offline-compute_PySpark_pyspark_019 | Campaign User Label Computation | offline-compute | PySpark | offline-compute/PySpark | en | pure-text | 900 | ## Prompt
I need you to generate a PySpark script that implements campaign user targeting label computation based on brand campaign activities (Campaign User Label Computation).
**Business Background and Objective**: In the Payment Platform W brand management platform, the targeting labels for campaign configurations ... | #!/usr/bin/env python3
"""pyspark_019 ground truth: campaign user label computation"""
import json
from pyspark.sql import SparkSession
from pyspark.sql.functions import lit, get_json_object, when, to_json, struct
spark = SparkSession.builder \
.appName('dataclaw_eval_gt_pyspark_019') \
.enableHiveSupport() \
... | tasks/offline-compute/PySpark/pyspark_019_en | ||
pyspark_020 | offline-compute_PySpark_pyspark_020 | 小程序H5监控 | offline-compute | PySpark | offline-compute/PySpark | zh | pure-text | 900 | ## Prompt
我需要你生成一段 PySpark 代码,实现小程序打开第三方 H5 页面的大盘监控指标计算(Mini-Program H5 Monitoring)。
**业务背景与目标**:小程序开放平台需要监控小程序内打开第三方 H5 页面的整体情况,包括 PV、UV、域名数、链接数等核心指标,按整体大盘和 Top100 小程序两个维度分别统计,同时按域名归属关系(同主体/关联主体/第三方)进行细分,产出结构化监控指标表。
**输入表**:
- `internal_platform_db.ods_daily_miniapp_h5_expand_raw_pyspark_212`
- `internal_platform_db... | #!/usr/bin/env python3
"""pyspark_020 ground truth: mini-program H5 monitoring metrics"""
import pandas as pd
from pyspark.sql import SparkSession
import pyspark.sql.functions as F
spark = SparkSession.builder \
.appName('dataclaw_eval_gt_pyspark_020') \
.enableHiveSupport() \
.config('spark.sql.warehouse.... | tasks/offline-compute/PySpark/pyspark_020 | ||
flinksql_001_en | online-compute_FlinkSQL_flinksql_001 | Order Stream and Payment Stream Interval Join | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses the built-in datagen connector to simulate an order stream and a payment stream, performing an Interval Join on `order_id`, and writing matched records directly to the console.
**Business Background and Objective**: Simulate an order stream and a payment stream using... | -- online_001: 订单流 + 支付流 Interval Join
-- 每个源生成 1 亿条数据 @ 1000 rows/sec
-- 1. 订单流 datagen 源表
CREATE TABLE orders_source (
order_id INT,
user_id INT,
order_time AS LOCALTIMESTAMP,
WATERMARK FOR order_time AS order_time - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',
'rows-per-second' = '1... | tasks/online-compute/FlinkSQL/flinksql_001_en | ||
flinksql_002_en | online-compute_FlinkSQL_flinksql_002 | Order-Payment Interval Join + Windowed Aggregation | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses two datagen built-in tables to simulate an order stream and a payment stream, performs an Interval Join on `order_id`, and then aggregates the order count and total payment amount over a 10-minute tumbling window, outputting the results to the console.
**Business Bac... | -- online_002: 订单支付 Interval Join + Tumble 窗口聚合
-- 每个源生成 1 亿条数据 @ 1000 rows/sec
-- 1. 订单流 datagen 源表
CREATE TABLE orders_source (
order_id INT,
user_id INT,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',
'rows-per-sec... | tasks/online-compute/FlinkSQL/flinksql_002_en | ||
flinksql_003_en | online-compute_FlinkSQL_flinksql_003 | Word Frequency Tumbling Window Statistics | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses a datagen built-in table to simulate a word frequency data stream, groups by `word` and opens a 1-minute tumbling window to count the occurrences of each word, and outputs the results to the console.
**Business Background and Objective**: Simulate a word frequency da... | -- online_003: 词频滚动窗口统计
-- 单源生成 10 亿条数据 @ 1000 rows/sec
-- 1. 词频流 datagen 源表
CREATE TABLE word_source (
word VARCHAR,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',
'rows-per-second' = '1000',
'fields.word.kind' = 'ra... | tasks/online-compute/FlinkSQL/flinksql_003_en | ||
flinksql_004_en | online-compute_FlinkSQL_flinksql_004 | Dual Window Aggregation (Tumble + Hop) | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses a datagen built-in table to generate order events, and computes the sales volume and order count per product using both a tumbling window and a sliding window, outputting the results to two separate console tables.
**Business Background and Objective**: Generate orde... | -- online_004: 双窗口聚合 (Tumble + Hop)
-- 单源生成 @ 50 rows/sec
-- 1. 订单事件 datagen 源表
CREATE TABLE orders_source (
order_id BIGINT,
product_id INT,
quantity INT,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',
'rows-per-... | tasks/online-compute/FlinkSQL/flinksql_004_en | ||
flinksql_005 | online-compute_FlinkSQL_flinksql_005 | 滚动窗口 TopN 商品排行 | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用 datagen 内置表模拟电商订单,按 10 秒滚动窗口做 Top-N 商品排行,输出销售额最高的前 3 个商品到 console。
**业务背景与目标**:用 datagen 内置表生成电商订单(字段 order_id / product_id / amount),每秒生成约 10 条。以 LOCALTIMESTAMP 作为事件时间,设置 5 秒的 Watermark 延迟。
按 10 秒滚动窗口做 Top-N 排行:每个窗口内统计每个商品的销售额 SUM(amount) 和订单数 COUNT(*),按销售额降序取前三名,打印到 console。
**源表定义**:... | -- online_005: 滚动窗口 TopN 商品排行
-- 单源生成 @ 10 rows/sec, Tumble 10s + ROW_NUMBER Top3
-- 1. 订单流 datagen 源表
CREATE TABLE orders_source (
order_id BIGINT,
product_id INT,
amount DOUBLE,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector' = '... | tasks/online-compute/FlinkSQL/flinksql_005 | ||
flinksql_006 | online-compute_FlinkSQL_flinksql_006 | 异常事件过滤 + 窗口 TopN | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用 datagen 内置表造设备事件流,过滤出异常事件后按省份做窗口 TopN 排名,输出到 console。
**业务背景与目标**:用内置 datagen 表生成设备事件数据,字段包括 device_id(int)、event_type(int)、province(string)、ts(timestamp),每秒 80 条,event_type 取值 1-10,province 长度 4 字符,用 ts 字段作为事件时间开 1 分钟滚动窗口(watermark 延迟 5 秒),先过滤 event_type=3 的异常事件,然后按省份分组统计每分钟的异常事件数,按异常数降序... | -- flinksql_006: 异常事件过滤 + 窗口 TopN
-- datagen 生成设备事件流 @ 80 rows/sec, event_type=3 过滤后 Tumble 1min Top-5
-- 1. 设备事件流 datagen 源表
CREATE TABLE device_source (
device_id INT,
event_type INT,
province VARCHAR,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WI... | tasks/online-compute/FlinkSQL/flinksql_006 | ||
flinksql_007 | online-compute_FlinkSQL_flinksql_007 | 用户行为滚动窗口统计 | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用 datagen 内置表造用户行为流,开滚动窗口统计每个用户的 action 数,结果写到 console。
**业务背景与目标**:用 datagen 内置数据源表模拟用户行为数据流,每秒生成 50 条记录,包含三个字段:userId(用户ID,字符串,长度6)、action(动作类型,字符串,长度8)、ftime(事件时间,timestamp 类型)。请基于这个 datagen 表,按事件时间做 1 分钟滚动窗口聚合,统计每个用户在每个 1 分钟窗口内的 action 总次数,并把结果(用户ID、动作次数、窗口起始时间)写入到内置控制台表中输出。事件时间字段 ftime... | -- flinksql_007: 用户行为滚动窗口统计
-- datagen 生成用户行为流 @ 50 rows/sec, Tumble 1min 窗口聚合
-- 1. 用户行为流 datagen 源表
CREATE TABLE user_source (
userId VARCHAR,
action VARCHAR,
ftime AS LOCALTIMESTAMP,
WATERMARK FOR ftime AS ftime - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',
'rows-per-second' = '50'... | tasks/online-compute/FlinkSQL/flinksql_007 | ||
flinksql_008_en | online-compute_FlinkSQL_flinksql_008 | Session Window User Behavior Aggregation | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses a datagen built-in table to simulate a user behavior stream, performs session window aggregation to compute behavioral metrics per user within each session, and outputs the results to the console.
**Business Background and Objective**: Simulate a user behavior data s... | -- flinksql_008: 会话窗口用户行为聚合
-- datagen 生成用户行为流 @ 50 rows/sec, SESSION 30min 窗口聚合
-- 1. 用户行为流 datagen 源表
CREATE TABLE user_source (
userId VARCHAR,
action VARCHAR,
action_time TIMESTAMP(3),
ftime AS LOCALTIMESTAMP,
WATERMARK FOR ftime AS ftime - INTERVAL '5' SECOND
) WITH (
'connector' = 'datage... | tasks/online-compute/FlinkSQL/flinksql_008_en | ||
flinksql_009_en | online-compute_FlinkSQL_flinksql_009 | Tumbling Window PV/UV Statistics | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses a datagen built-in table to simulate a user click stream, computes PV and UV per page over a window, and writes the results to the console.
**Business Background and Objective**: Simulate a user click stream using a datagen built-in table (`user_id` ranging from 1–10... | -- flinksql_009: 滚动窗口 PV/UV 统计
-- datagen 生成用户点击流 @ 10000 rows/sec, Tumble 1min PV/UV
-- 1. 用户点击流 datagen 源表
CREATE TABLE click_source (
user_id INT,
page_id INT,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',
'rows-p... | tasks/online-compute/FlinkSQL/flinksql_009_en | ||
flinksql_010 | online-compute_FlinkSQL_flinksql_010 | 滑动窗口(HOP)店铺统计 | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用 datagen 模拟订单流,按店铺做滑动窗口统计订单金额和数量,写入 console。
**业务背景与目标**:用 datagen 模拟订单流(order_id 取值 1~1000000、shop_id 取值 1~100、amount 取值 0~1000,每秒 5000 条),按 1 分钟步长、5 分钟窗口大小做 HOP 滑动窗口统计每个店铺的订单总额(SUM)、订单数(COUNT)和平均金额(AVG),写入 console。
**源表定义**:
- `order_source`(订单流,datagen 连接器):
- order_id BIGINT:订单 ID,随... | -- flinksql_010: 滑动窗口(HOP)店铺统计
-- datagen 生成订单流 @ 5000 rows/sec, HOP 1min slide 5min window
-- 1. 订单流 datagen 源表
CREATE TABLE order_source (
order_id BIGINT,
shop_id INT,
amount DOUBLE,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '10' SECOND
) WITH (
'connect... | tasks/online-compute/FlinkSQL/flinksql_010 | ||
flinksql_011_en | online-compute_FlinkSQL_flinksql_011 | Tumbling Window Product TopN Ranking | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses the built-in datagen connector to simulate an order data source, aggregates product sales over a 10-minute tumbling window, and then uses the `ROW_NUMBER` window function to retrieve the top 5 products by sales within each window, outputting the results to the console... | -- flinksql_011: 滚动窗口商品 TopN 排行
-- 10-min TUMBLE + SUM(amount) + COUNT(*) + ROW_NUMBER Top-5
-- 1. 订单源 datagen 表
CREATE TABLE order_source (
order_id BIGINT,
product_id INT,
amount DOUBLE,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'conne... | tasks/online-compute/FlinkSQL/flinksql_011_en | ||
flinksql_012_en | online-compute_FlinkSQL_flinksql_012 | Session Window User Behavior Statistics | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses the built-in datagen connector to simulate a user behavior data source, computes per-user behavioral statistics over a 30-minute session window (`SESSION`), and outputs the results to the console.
**Business Background and Objective**: Simulate a user behavior stream... | -- flinksql_012: 会话窗口用户行为统计
-- 30-min SESSION + COUNT + COUNT DISTINCT
-- 1. 用户行为 datagen 源表
CREATE TABLE user_actions (
user_id INT,
action_id INT,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',
'rows-per-second' = '... | tasks/online-compute/FlinkSQL/flinksql_012_en | ||
flinksql_013 | online-compute_FlinkSQL_flinksql_013 | 累积窗口日活统计 (Cumulate UV) | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用 datagen 内置连接器模拟用户登录数据源,通过累积窗口(CUMULATE)统计日活 UV 和登录次数,输出到 console。
**业务背景与目标**:用 datagen 内置表模拟用户登录流水。使用 CUMULATE TVF 累积窗口,窗口步长 1 分钟、最大窗口 1 天,统计每个累积窗口内的独立用户数(UV)和登录总次数,输出到 console。
**源表定义**:
- `user_source`(用户登录流,datagen 连接器):
- user_id INT:用户 ID,随机取值 1~100000
- device_id INT:设备 ID,随机取... | -- flinksql_013: 累积窗口日活统计 (Cumulate UV)
-- CUMULATE(1min step, 1day max) + COUNT DISTINCT + COUNT
-- 1. 用户登录 datagen 源表
CREATE TABLE user_source (
user_id INT,
device_id INT,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',... | tasks/online-compute/FlinkSQL/flinksql_013 | ||
flinksql_014 | online-compute_FlinkSQL_flinksql_014 | Interval Join + 窗口聚合 (订单支付) | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用两个 datagen 内置连接器模拟订单流和支付流,先按 order_id 做 Interval Join 匹配订单与支付,再对匹配结果做 10 分钟滚动窗口聚合统计,输出到 console。
**业务背景与目标**:用两张 datagen 内置表分别模拟订单流和支付流。先按 order_id 做 Interval Join(支付时间在订单时间前后 10 分钟内),对匹配上的记录按 10 分钟滚动窗口聚合,统计每个窗口内的订单数和支付总额,输出到 console。
**源表定义**:
- `orders_source`(订单流,datagen 连接器):
- orde... | -- flinksql_014: Interval Join + 10-min TUMBLE 窗口聚合 (订单支付)
-- 双源 Interval Join → TUMBLE 聚合 → COUNT + SUM
-- 1. 订单流 datagen 源表
CREATE TABLE orders_source (
order_id INT,
user_id INT,
order_time AS LOCALTIMESTAMP,
WATERMARK FOR order_time AS order_time - INTERVAL '60' SECOND
) WITH (
'connector' = 'd... | tasks/online-compute/FlinkSQL/flinksql_014 | ||
flinksql_015 | online-compute_FlinkSQL_flinksql_015 | Regular Join 曝光点击关联 | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用两个 datagen 内置连接器分别模拟广告曝光流和广告点击流,通过 Regular Join(常规内连接)关联曝光与点击,输出到 console。
**业务背景与目标**:用两张 datagen 内置表分别模拟广告曝光和广告点击数据。Regular Join 不需要事件时间或 Watermark,直接按 user_id 和 ad_id 做内连接,将同一用户对同一广告的曝光和点击关联起来输出。
**源表定义**:
- `impression_source`(曝光流,datagen 连接器):
- imp_id BIGINT:曝光 ID,随机取值 1~10000000
... | -- flinksql_015: Regular Join (广告曝光 + 点击)
-- 双源无 WATERMARK + INNER JOIN on user_id AND ad_id
-- 1. 曝光流 datagen 源表 (无 event_time, 无 WATERMARK)
CREATE TABLE impression_source (
imp_id BIGINT,
user_id INT,
ad_id INT
) WITH (
'connector' = 'datagen',
'rows-per-second' = '5000',
'fields.imp_id.kind'... | tasks/online-compute/FlinkSQL/flinksql_015 | ||
flinksql_016 | online-compute_FlinkSQL_flinksql_016 | 滚动窗口多维聚合 (GROUPING SETS) | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用 datagen 内置连接器模拟事件流,按 1 分钟滚动窗口做 GROUPING SETS 多维聚合,结果打到 console。
**业务背景与目标**:用 datagen 内置表生成设备事件流,共 5000 行/秒。字段包括 os_id(操作系统 ID,1~3)、device_id(设备 ID,1~20)、city_id(城市 ID,1~100)。使用 LOCALTIMESTAMP 作为事件时间,设置 5 秒 Watermark 延迟。
按 1 分钟 TUMBLE 滚动窗口,使用 GROUPING SETS 进行多维分组聚合,分组组合包括:(os_id, device_... | -- flinksql_016: 滚动窗口多维聚合 (GROUPING SETS) — TVF syntax
-- 生成 5000 行/秒的设备事件流
-- 1. 设备事件流 datagen 源表
CREATE TABLE event_source (
os_id INT,
device_id INT,
city_id INT,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',
... | tasks/online-compute/FlinkSQL/flinksql_016 | ||
flinksql_017_en | online-compute_FlinkSQL_flinksql_017 | Row-Level TopN (Windowless) | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses the built-in datagen connector to simulate a spending stream, retrieves the top 3 records by spending amount grouped by `country_id` without any window, and outputs the results directly to the console.
**Business Background and Objective**: Generate user spending rec... | -- flinksql_017: 行级 TopN (无窗口)
-- 生成 1000 行/秒的用户消费流
-- 1. 用户消费流 datagen 源表(无事件时间/Watermark)
CREATE TABLE spend_source (
country_id INT,
user_id INT,
cost_money DOUBLE
) WITH (
'connector' = 'datagen',
'rows-per-second' = '1000',
'fields.country_id.kind' = 'random',
'fields.country_id.min' =... | tasks/online-compute/FlinkSQL/flinksql_017_en | ||
flinksql_018_en | online-compute_FlinkSQL_flinksql_018 | Dual Output (Detail + Windowed Aggregation) | online-compute | FlinkSQL | online-compute/FlinkSQL | en | pure-text | 600 | ## Prompt
I need you to write a Flink SQL that uses the built-in datagen connector to simulate an order stream, simultaneously outputting detail records to `console1` and windowed aggregation results over a 1-minute tumbling window to `console2`.
**Business Background and Objective**: Generate an order event stream us... | -- flinksql_018: 双输出 (明细 + 窗口聚合)
-- 生成 2000 行/秒的订单事件流
-- 1. 订单事件流 datagen 源表
CREATE TABLE order_source (
order_id BIGINT,
user_id INT,
amount DOUBLE,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector' = 'datagen',
'rows-per-second... | tasks/online-compute/FlinkSQL/flinksql_018_en | ||
flinksql_019 | online-compute_FlinkSQL_flinksql_019 | 全局分组 + 过滤统计 | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用 datagen 内置连接器模拟交易流,按状态过滤后全局分组统计,结果打到 console。
**业务背景与目标**:用 datagen 内置表生成交易事件流,共 3000 行/秒。字段包括 trade_id(交易 ID)、type(交易类型,1~5)、status(状态,0~2)、amount(交易金额,0~5000)。
注意:`type` 和 `status` 是 SQL 保留字,需要使用反引号包裹(例如 `` `type` ``、`` `status` ``)。
先按 status = 1 过滤,再按 type 分组统计交易笔数和交易金额总和,最后输出到 cons... | -- flinksql_019: 全局分组 + 过滤统计
-- 生成 3000 行/秒的交易事件流,使用反引号包裹保留字
-- 1. 交易事件流 datagen 源表(无事件时间/Watermark)
CREATE TABLE trade_source (
trade_id BIGINT,
`type` INT,
`status` INT,
amount DOUBLE
) WITH (
'connector' = 'datagen',
'rows-per-second' = '3000',
'fields.trade_id.kind' = 'random',
'fie... | tasks/online-compute/FlinkSQL/flinksql_019 | ||
flinksql_020 | online-compute_FlinkSQL_flinksql_020 | 窗口去重 (TVF Dedup) | online-compute | FlinkSQL | online-compute/FlinkSQL | zh | pure-text | 600 | ## Prompt
我需要你写一段 Flink SQL,用 datagen 内置连接器模拟事件流,使用 TUMBLE TVF 窗口表值函数 + ROW_NUMBER 做窗口去重,每个窗口内每个用户只保留最早的一条事件。
**业务背景与目标**:用 datagen 内置表生成用户事件流,共 5000 行/秒。字段包括 user_id(用户 ID,1~10000)、event_id(事件 ID)、event_type(事件类型,1~8)。使用 LOCALTIMESTAMP 作为事件时间,设置 10 秒 Watermark 延迟。
使用 TUMBLE 表值函数(TABLE(TUMBLE(...)))将事件分配到 5 分钟滚动窗口,然后... | -- flinksql_020: 窗口去重 (TVF Dedup)
-- TUMBLE TVF + ROW_NUMBER 按窗口去重,保留每个窗口每个用户的第一条
-- 1. 用户事件流 datagen 源表
CREATE TABLE event_source (
user_id INT,
event_id BIGINT,
event_type INT,
event_time AS LOCALTIMESTAMP,
WATERMARK FOR event_time AS event_time - INTERVAL '10' SECOND
) WITH (
'connector' = '... | tasks/online-compute/FlinkSQL/flinksql_020 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.