All Products
Search
Document Center

:Publish a Task

Last Updated:Jan 25, 2024

This topic describes the configurations of placeholders and task running in data preparation.

Prerequisites

Data is processed and exported. For more information, see Output data.

Placeholder management

Placeholder management is used to configure placeholders that can be referenced by data preparation (lightweight ETL) input and output components, including static and dynamic placeholders, and can be used to dynamically run tasks on a periodic basis. If you need to configure a placeholder, click the icon in the 全局参数main toolbar.

image.png

On the Placeholder Management page, set Variable Name and Query Default Value.

image.png

There are two types of placeholder formats: static placeholders and dynamic placeholders. They can be referenced in the filter conditions of an input component and the partition settings of an output component.

Placeholder format design

  • The placeholder format is KeyA = ValueA. where KeyA is the placeholder name (variable name) and ValueA is the placeholder value (static field).

  • Two placeholder formats are supported:

    • static field format, for example: user=myname

    • Dynamic value format, for example: mydate=${bizdate}

Dynamic placeholder

Dynamic placeholders take different values according to different up time, which can be used to run tasks at dynamic time. A dynamic placeholder consists of a base date placeholder and a time interval offset:

  • Date dynamic placeholder: provides two methods based on the business date and execution time.

    • The {yyyyMMdd} is the business date, that is, the day before the current update data date, that is, the T-1 date.

    • The [yyyyMMdd] is the execution date, that is, the date T of the current update data. T is the granularity of the day.

  • Offset for the hour placeholder: Provides an offset based on the hour.

    • HH for hours

    • mm for minutes

    • ss for seconds

    • Offset of hours: delta/24

    For example, the expression 1 hour before the specified execution time is: $[HH-1/24].

  • Offset for minute placeholder: Provides a minute-based offset.

    • HH for hours

    • mm for minutes

    • ss for seconds

    • Minute offset: delta/24/60

    For example, 1 minute before the business date: ${HHmmss-1/24/60}.

  • Seconds are not supported.

Type

Placeholder Format

Placeholder description

System dynamic placeholder

${bizdate}

The business date. The default format is ${yyyyMMdd}, when the task was run, the date of the previous day, and the T-1.

For example, if the current value is 2021-12-29, the ${bizdate} is 20211228.

${dueTime}

The execution date, in the default format of $[yyyyMMdd]. The date of the current day when the task is run, that is, T.

For example, if the current value is 2021-12-29, the ${duedate} is 20211229.

The following table describes the dynamic placeholders for a specific time.

Current Date

Business date (T-1) based configuration

Actual Value

Configurations Based on Estimated Execution Time (T)

Actual Value

2022-01-10

${yyyyMMdd}

20220109

$[yyyyMMdd]

20220110

2022-01-10

${yyyyMMdd-1}

20220108

$[yyyyMMdd-1]

20220109

2022-01-10

${yyyyMMdd-7}

20220102

$[yyyyMMdd-7]

20220103

2022-01-10

${yyyy-MM-dd}

2022-01-09

$[yyyy-MM-dd]

2022-01-10

2022-01-10

${yyyy-MM}

2022-01

$[yyyy-MM]

2022-01

2022-01-10

${yyyy-MM-1}

2021-12

$[yyyy-MM -1]

2021-12

2022-01-10

${yyyy}

2022

$[yyyy]

2022

2022-01-10

${yyyy+1}

2023

$[yyyy+1]

2023

2022-01-10

${yyyy/MM/dd HH:mm:ss}

2022/01/09 00:00:00

$[yyyy/MM/dd HH:mm:ss]

2022/01/10 00:00:00

2022-01-10

${yyyy/MM/dd HH:mm:ss-1/24}

2022/01/08 23:00:00

$[HH:mm:ss-5/24/60]

23:55:00

2022-01-10

${HH}

00

$[HH]

The hour corresponding to dueTime.

2022-01-10

${HH-1}

${HH-1/24}

23

$[HH-1]

$[HH-1/24]

Hour corresponding to dueTime -1

Task running configuration

After you create data preparation, you must run the command before you can write data to the database table.

  1. Go to the Data Preparation page.

  2. In the main toolbar, click the Run Configuration icon.

    image.png

  3. In the Run Configuration step, set the Run Type and Cycle and click OK.

    You can select Periodic Run or Manual Run.

    • If you select Manual, data is updated only after the trigger is manually triggered.

    • After you select Periodic and specify the time, the data is updated on a monthly, weekly, daily, or hourly basis.

  4. Click Save and Publish.

After the configuration is complete, you can view the status of the newly created task on the Data Preparation page.

image

For more information, see View the status of a task.