-
Notifications
You must be signed in to change notification settings - Fork 249
Example 2
jun-he edited this page May 14, 2025
·
3 revisions
Add time based scheduling
{
"properties": {
"owner": "tester",
"run_strategy": "sequential"
},
"workflow": {
"time_triggers": [
{
"expression": "@daily",
"timezone": "US/Pacific",
"fuzzy_max_delay": "2 hours 30 mins",
"type": "PREDEFINED"
},
{
"expression": "@daily",
"timezone": "Asia/Tokyo",
"type": "PREDEFINED"
},
{
"cron": "45 0 * * *",
"timezone": "UTC",
"type": "CRON"
}
],
"id": "demo.pipeline",
"params": {
"SOURCE_TABLE": {
"value": "table_foo",
"type": "STRING"
},
"TARGET_TABLE": {
"value": "table_bar",
"type": "STRING"
},
"my_query": {
"value": "INSERT OVERWRITE TABLE ${TARGET_TABLE} SELECT USER_ID, DATE_INT, SUM(watch_time) FROM ${SOURCE_TABLE} WHERE is_active=true AND DATE_INT > DATE_MINUS_7 group by USER_ID, DATE_INT;",
"type": "STRING"
}
},
"steps": [
{
"step": {
"id": "job.1",
"type": "NoOp",
"params": {
"spark": {
"value": {
"script": {
"value": "${my_query}",
"type": "STRING"
}
},
"type": "MAP"
}
}
}
}
]
}
}