tencent cloud

Feedback

Scheduling Parameters

Last updated: 2024-11-01 16:35:05

1. Time Parameter

Scheduling parameters are used during task scheduling. They automatically replace values according to the business time of task scheduling and the value format of scheduling parameters, achieving dynamic value substitution within the task scheduling time.
Currently, two scheduling parameters are supported: instance data time and planned scheduling time.
Scope: DataInLong and data computation tasks.
Scheduling Parameters
Parameter Value
Parameter Description
Instance Data Time
${...} is the time parameter of the Self Definition parameter format. 'yyyy' represents a 4-digit year, 'yy' represents a 2-digit year, 'MM' represents the month, 'dd' represents the day, 'HH' represents the hour, 'mm' represents the minute, and 'ss' represents the second. Parameters can be combined in any way, for example, ${yyyyMMdd}, ${yyyy-MM-dd}, ${HH:mm:ss}, and ${yyyyMMddHHmmss}, etc
Refers to the time for processing business data of the task, accurate to the second. Data time can be obtained through ${yyyyMMddHHmmss}.
The default T + 0 method, with the data time rules as follows:
Minute task, data time = scheduled dispatch time;
Hourly task, data time is yyyy-MM-dd HH:00:00 (yyyy-MM-dd HH is consistent with scheduled dispatch time);
Daily, Weekly, Yearly, Monthly task, data time is yyyy-MM-dd 00:00:00 (yyyy-MM-dd is consistent with scheduled dispatch time).
For test runs, the time obtained is the submission execution time.



Common Parameters:
${yyyyMMdd}
${yyyy-MM-dd}
${HH:mm:ss}
${yyyyMMddHHmmss}
Scheduled Time
$(…) is the time parameter in the Definition parameter format.
Refers to the instance scheduling time, which is also the instance generation time, accurate to the second. The planned scheduling time can be obtained through $(yyyyMMddHHmmss).

Common Parameters:
$(yyyyMMdd)
The following are common parameter formats for instance data time:
Time
Time Parameter Formats
Remarks
N Years Later
${yyyyMMdd+Ny}
If reference dt=${yyyyMMdd-1M}, it will be replaced as: dt=20210610 If reference , it will be replaced as: dt=20210709 If reference time=${yyyyMMddHHmmss-3h}, it will be replaced as: time=20210710050000 If reference ti=${yyyyMMddHHmmss-25m}, it will be replaced as: ti=20210710073500
N Years Ago
${yyyyMMdd-Ny}
N Months Later
${yyyyMMdd+NM}
N Months Ago
${yyyyMMdd-NM}
N Weeks Later
${yyyyMMdd+Nw}
N Weeks Ago
${yyyyMMdd-Nw}
N Days Later
${yyyyMMdd+Nd}
N Days Ago
${yyyyMMdd-Nd}
N Hours Later
${yyyyMMddHHmmss+NH}
Previous N hours
${yyyyMMddHHmmss-NH}
Next N minutes
${yyyyMMddHHmmss+Nm}
Previous N minutes
${yyyyMMddHHmmss-Nm}
Dispatch Timestamp (10 digits)
${timestamp}
${timestamp}=1625875200 Supports the use of "+", "-" and other operators.
Dispatch Timestamp (13 digits)
${timestamp_ms}
${timestamp_ms}=1698508800000
Supports using "+", "-", and other operators for processing.
Provides quick conversion expressions for common dates as follows:
Serial number
Time Parameter Formats
Description
1
${yyyyMMdd+TE}
TENDAY END data date corresponds to the end of the ten-day period
2
${yyyyMMdd+ME}
MONTH END data date corresponds to the end of the month
3
${yyyyMMdd+QE}
QUARTER END data date corresponds to the end of the quarter
4
${yyyyMMdd+HYE}
HALF YEAR END data date corresponds to the end of the half year
5
${yyyyMMdd+YE}
YEAR END data date corresponds to the end of the year
6
${yyyyMMdd+TS}
TENDAY START data date corresponds to the start of the ten-day period
7
${yyyyMMdd+MS}
MONTH START data date corresponds to the start of the month
8
${yyyyMMdd+HYS}
HALFYEAR START data date corresponds to the start of the half year
9
${yyyyMMdd+YS}
YEAR START data date corresponds to the start of the year
10
${yyyyMMdd+PME}
PRI MONTH END data date corresponds to the end of the previous month
11
${yyyyMMdd+PYE}
PRI YEAR END data date corresponds to the end of the previous year

The following are common parameter formats for planned scheduling time:
Time
Time Parameter Formats
Remarks
Scheduling Time
$(yyyyMMddHHmmss)
If referencing dt=$(yyyyMMdd-1M), it will be replaced with: dt=20210610
If referencing , it will be replaced with: dt=20210709
If referencing time=$(yyyyMMddHHmmss-3h), it will be replaced with: time=20210710050000
If referencing ti=$(yyyyMMddHHmmss-25m), it will be replaced with: ti=20210710073500
N Years Later
$(yyyyMMdd+Ny)
N Years Ago
$(yyyyMMdd-Ny)
N Months Later
$(yyyyMMdd+NM)
N Months Ago
$(yyyyMMdd-NM)
N Weeks Later
$(yyyyMMdd+Nw)
N Weeks Ago
$(yyyyMMdd-Nw)
N Days Later
$(yyyyMMdd+Nd)
N Days Ago
$(yyyyMMdd-Nd)
N Hours Later
$(yyyyMMddHHmmss+NH)
Previous N hours
$(yyyyMMddHHmmss-NH)
Next N minutes
$(yyyyMMddHHmmss+Nm)
Previous N minutes
$(yyyyMMddHHmmss-Nm)
Dispatch Timestamp
$(timestamp)
$(timestamp)=1625875200 supports the use of "+", "-" and other operators.

2. Other System-Built-in Parameters

Parameter
Meaning
${projectIdent}
Project Identifier
${workflowName}
Workflow name
${taskName}
Task Name
${taskId}
Task ID
${taskInCharge}
Person in Charge
${taskType}
Task Type
Usage Scenario 1: Directly used in SQL to obtain information such as the current project and workflow.
select "${projectIdent}" as projectIdent, "${workflowName}" as workflowName, "${taskName}" as taskName, "${taskId}" as taskId, "${taskInCharge}" as taskInCharge, "${taskType}" as taskType, user_id from wedata_demo_db.user_info limit 10;
Usage Scenario 2: Used in SparkSQL, PySpark, and Spark tasks to specify the task name on Yarn with --name + variable.
--name ${projectIdent}-${workflowName}-${taskInCharge}
When connecting to kyuubi data source in SparkSQL, the parameter name currently needs to be specified using spark.app.name.
spark.app.name=${projectIdent}-${workflowName}-${taskInCharge}



Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support