Datasets:
metadata
id: offline-compute_PrestoSQL_prestosql_007
name: APK Threat Scan Instance GPU Card-Hour 5-Minute Window Statistics
category: offline-compute/PrestoSQL
timeout_seconds: 900
modality: pure-text
engine: prestosql
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_007(GPU monitoring data table)containerSTRING — container namepod_nameSTRING — Pod namepkg_timeSTRING — reporting time (epoch second string)gpu_nameSTRING — GPU modelmetricSTRING — metric namevalueSTRING — metric valuedtSTRING — partition field (format'2026060800')
internal_platform_db.dwd_scan_instance_podname_prestosql_007(Pod-to-scan-instance mapping table)dtSTRING — partition fieldinstance_uuidSTRING — instance unique identifierpod_nameSTRING — Pod namepod_phaseSTRING — Pod phasenamespaceSTRING — namespace
internal_platform_db.dwd_scan_task_instance_prestosql_007(task instance GPU configuration table 1)databus_imp_dateSTRING — partition fieldinstance_uuidSTRING — instance unique identifierhost_gpu_numDOUBLE — host GPU card counthost_numDOUBLE — host countlast_modifyDOUBLE — last modification timestampgpu_nameSTRING — GPU model
internal_platform_db.scan_task_instance_prestosql_007(scan task instance GPU configuration table 2)databus_imp_dateSTRING — partition fieldinstance_uuidSTRING — instance unique identifierhost_gpu_numDOUBLE — host GPU card counthost_numDOUBLE — host countlast_modifyDOUBLE — last modification timestampgpu_nameSTRING — GPU modelscan_typeSTRING — scan type
Computation Logic:
- Filter specified metrics from the GPU monitoring data, and compute runtime per Pod in 5-minute time windows
- Join with the Pod-to-instance mapping to aggregate the GPU runtime and Pod count per instance per 5-minute window
- Retrieve the latest GPU configuration information for each task instance
- Compute the GPU card-hours (GPU-hour) per instance per 5-minute window
- The specific time window bucketing method, join conditions, aggregation logic, and GPU-hour computation formula must be determined based on the table structures and business semantics
Output Requirements:
- Target table:
internal_platform_db.t_scan_instance_gpu_time_stats_cand_prestosql_007 - Output fields and order:
instance_uuidSTRING,time_5minBIGINT,host_gpu_numDOUBLE,sum_run_time_mDOUBLE,gpu_hourDOUBLE,gpu_nameSTRING,pod_countBIGINT,host_numDOUBLE - If the target table does not exist, first create the table, then write the data
- Use Presto/Trino SQL syntax; do not use Hive/Spark SQL dialects
Environment and Execution Notes:
- Presto is running, connected via the Hive catalog
- Execute SQL:
presto-cli --catalog hive --schema internal_platform_db -f /tmp_workspace/result.sql - After writing
result.sql, you must execute it yourself to verify that it runs successfully and produces correct data