Datasets:
id: offline-compute_MySQL_mysql_011
name: Low-Value Task Benefit Aggregation Statistics by Application Group
category: offline-compute/MySQL
timeout_seconds: 1800
modality: pure-text
engine: mysql
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 benefits (task count, runtime, CPU, memory) and estimated benefits (task count, runtime, CPU, memory) at the application group level to evaluate governance effectiveness. This task groups the detail data from the specified partition of the input table by four dimension fields, applies SUM aggregation to all metric fields, and writes the results to the output table.
Input Table (full name + brief description):
internal_platform_db.dws_low_value_task_compute_statistics_day_mysql_011(low-value task compute benefit detail daily table)
(Please connect to the database and query to confirm the table structure and field semantics.)
Processing Rules:
- No joins, single-table processing
- Filter condition:
dt = '20260507' - Aggregation logic: Group by
plan_product_name,obs_product_name,product_name,dw_appgroup, applying SUM to all metric fields (actural_task_count,actural_time_sum_hour,actural_vcore_sum_vcore_hour,actural_memory_sum_gb_hour,estimated_task_count,estimated_time_sum_hour,estimated_vcore_sum_vcore_hour,estimated_memory_sum_gb_hour)
Output Requirements:
- Target table:
internal_platform_db.dws_low_value_task_compute_appgroup_stats_day_cand_mysql_011 - Output field order:
dt,plan_product_name,obs_product_name,product_name,dw_appgroup,actural_task_count,actural_time_sum_hour,actural_vcore_sum_vcore_hour,actural_memory_sum_gb_hour,estimated_task_count,estimated_time_sum_hour,estimated_vcore_sum_vcore_hour,estimated_memory_sum_gb_hour dtfield value:'20260507'- Types:
dtVARCHAR(8),plan_product_nameVARCHAR(256),obs_product_nameVARCHAR(256),product_nameVARCHAR(256),dw_appgroupVARCHAR(256),actural_task_countINT,actural_time_sum_hourDOUBLE,actural_vcore_sum_vcore_hourDOUBLE,actural_memory_sum_gb_hourDOUBLE,estimated_task_countINT,estimated_time_sum_hourDOUBLE,estimated_vcore_sum_vcore_hourDOUBLE,estimated_memory_sum_gb_hourDOUBLE - If the target table does not exist, first create it using standard MySQL InnoDB format, then write the data
- Use standard MySQL syntax; do not use Hive/Spark SQL dialects (e.g.,
INSERT OVERWRITE,STORED AS ORC,PARTITIONED BYare not supported) - Write method: Use
INSERT INTO ... SELECT ...statements
Environment and Execution Notes:
- Your final output must be written to the file
/tmp_workspace/result.py, notresult.sql - The local MySQL is running at localhost:3306, username
root, passwordroot123 - Use Python
pymysqlinresult.pyto execute the SQL (do not use themysqlcommand-line tool) - The script must include complete table creation (if the target table does not exist) and data writing logic
- After writing
result.py, you must executepython3 /tmp_workspace/result.pyyourself to verify that it runs successfully and produces correct data