All Products
Search
Document Center

DataWorks:Scenario: Change the time zone for scheduling

Last Updated:Dec 06, 2024

Before you create a DataWorks workspace, you must select the region where you want the workspace to reside. By default, the time zone of the region where the DataWorks workspace resides is the time zone for scheduling. You can change the time zone for scheduling in the workspace. This topic describes how to change the time zone for scheduling in a workspace.

Background information

Regions that support changing of the time zone for scheduling

DataWorks allows you to change the time zone for scheduling in workspaces that reside in specific regions. The following table describes the regions that support changing of the time zone for scheduling and the supported time zones for each region.

Note

In this example, the UTC time zone refers to UTC+0. The time in this time zone is consistent with the global standard time. No time difference is generated.

Region

Local time zone

UTC time zone

Asia/Shanghai time zone

US (Silicon Valley)

America/Los_Angeles

Supported

Supported

US (Virginia)

America/New_York

Supported

Supported

Germany (Frankfurt)

Europe/Berlin

Supported

Supported

Singapore

Asia/Singapore

Supported

Supported (same as the local time zone)

China (Hong Kong)

Asia/Hong_Kong

Supported

Supported (same as the local time zone)

Japan (Tokyo)

Asia/Tokyo

Supported

Not supported

(Required) Precautions for changing the time zone for scheduling

To prevent errors from occurring on nodes in the production environment and unexpected running results of nodes due to the change in the time zone for scheduling, make sure that you are familiar with the precautions before you change the time zone for scheduling. The following table describes the precautions.

Item

Description

Scope of workspaces that are affected by the change.

The time zone for scheduling is a region-level setting. After you change the time zone for scheduling in a workspace, the change takes effect for all workspaces of all users within the current tenant in the region where the workspace resides.

Changing of the time zone for scheduling is irreversible.

You cannot change the time zone for scheduling twice. We recommend that you do not perform this operation unless the operation is required for your business scenario.

Important

If you have existing workspaces in a region that supports changing of the time zone for scheduling and want to change the time zone for scheduling, you may need to migrate existing nodes and instances. In addition, the business may be affected when you perform the change. You must read and understand the related descriptions for changing the time zone for scheduling in this topic and determine whether to perform the change based on evaluation results.

Scope of the settings that are affected by the change.

After you change the time zone for scheduling, the related settings of a node are affected, such as the scheduling settings of the node and the replacement of scheduling parameters in the node code in DataWorks. The values of the scheduling parameters are calculated based on the scheduling time and data timestamp of a node and are used as input parameters in the node code in the scheduling scenario.

Important
  • The time zone of an underlying engine is determined by the engine and is irrelevant to the change in the time zone for scheduling. Therefore, the time zone of the engine is not affected by the change.

  • The change in the time zone for scheduling takes effect only for the time properties for scheduling of a node and does not affect the time zone of the related engine. The replacement values of the scheduling parameters of the node are issued to the engine as strings for processing based on the processing rules at the engine side. For information about the processing rules at the engine side, see the documentation about the time zone of the engine.

  • Specific operations in DataStudio, such as running a workflow and performing smoke testing in the development environment, are processed by the scheduling system. Therefore, time-related parameters in the code of a node are affected by the change in the time zone for scheduling. However, specific operations in DataStudio such as debugging a single node and performing an ad hoc query are not processed by the scheduling system. Therefore, such operations are not affected by the change.

Impacts that are exerted on specific items in DataWorks after you change the time zone for scheduling

After you change the time zone for scheduling, specific items in DataWorks are affected, such as the scheduling settings of a node, the replacement of scheduling parameters in the scheduling scenario, and the time display in specific DataWorks modules.

Note
  • The change in the time zone for scheduling takes effect only for the scheduling scenario. Most operations in DataStudio are not processed in the scheduling system. Therefore, time-related parameters in the code of a node are replaced based on the time zone of the region where the current DataWorks workspace resides by default when the node is run in DataStudio. For example, if you perform operations in DataStudio such as running a single node, running a node with parameters, or performing an ad hoc query, the operations are not affected by the change.

  • Specific operations in DataStudio such as running a workflow and performing smoke testing in the development environment are processed by the scheduling system. Therefore, time-related parameters in the code of a node are affected by the change in the time zone for scheduling.

1. Scheduling time of a node

The scheduling time of a node varies based on the time zone to which you change the current time zone.定时时间

2. Settings of time-related parameters of a node

The scheduling parameters of a node use the related time information, such as the scheduling time and data timestamp of the node, as base values and replace the variables in the node code by using the base values. The base values vary based on the change in the time zone for scheduling.

YYYYMMDD=${yyyymmdd} LAST_2D=${yyyymmdd-2}

时间参数设置

3. Processing logic for time information in the code of a node

Some variables in the code of a node are parsed by gateway nodes, and the rest of the variables in the node code are parsed at the related compute engine side. Variable parsing logic:

  • For variables in the code of a node that are parsed by gateway nodes, the values of the variables vary based on the time zone to which you change the current time zone. In a scheduling scenario, if you directly run a command, such as the date command for a Shell node, to query a point in time in a DataWorks node, such as a Shell node or a PyODPS node, the system returns a point in time based on the time zone for scheduling. Temporarily running a node in DataStudio is not a scheduling scenario.

  • For variables in the code of a node that are parsed at the related underlying compute engine side, the values of the variables are not affected by the change in the time zone for scheduling. We recommend that you refer to the time zone conversion rules of the underlying compute engine for details. For more information, see the documentation about the time zone of the underlying compute engine.

The following figure shows an example on how a variable in the code of a Hive node is replaced with a time string based on the scheduling time of the node and how the time string is issued to the Hive compute engine in a scheduling scenario. The specific time that is expressed is limited by the parsing logic at the Hive server side.节点代码

4. Time information related to baselines or alerts

The time information related to baselines or alerts varies based on the time zone to which you change the current time zone.

5. Time information related to APIs

The time information related to APIs varies based on the time zone to which you change the current time zone.

6. Time zone of an underlying engine

The time zone of an underlying engine, such as Data Integration or a MaxCompute compute engine, is determined by the underlying engine and is irrelevant to the change in the time zone for scheduling. The replacement values of scheduling parameters of a node are issued to the related underlying engine as strings for processing based on the processing rules at the engine side. For information about the processing rules at the engine side, see the documentation about the time zone of the engine.

Note

How to change the time zone for scheduling

DataWorks allows you to change the current time zone to another time zone for scheduling of nodes in DataWorks.

Scenario 1: The current tenant creates a workspace in a region for the first time.

The first time the current tenant creates a workspace in a region that supports changing of the time zone for scheduling, a message prompts the tenant to specify whether to change the time zone for scheduling to a time zone other than the local time zone. The tenant can determine whether to change the time zone for scheduling based on business requirements and the descriptions in (Required) Precautions for changing the time zone for scheduling. If the tenant wants to change the time zone for scheduling, the tenant must submit a ticket for technical support.

Scenario 2: The current tenant creates a workspace in a region where existing workspaces of the tenant reside.

When the current tenant creates a workspace in a region where existing workspaces of the tenant reside and the region supports changing of the time zone for scheduling, the tenant can also submit a ticket to change the time zone for scheduling for all workspaces in the region. However, migration of existing nodes and instances may be involved and the business may be affected when the tenant performs the change. Therefore, the tenant must fully understand the consequences of the change. The change roughly involves the following aspects:

  1. User side: Evaluate the scope of impacts of the change on existing nodes and instances.

  2. DataWorks side: Migrate existing nodes and instances.

  3. DataWorks side: Specify a new time zone.

  4. User side: Restore existing nodes and instances and verify the new time zone.

    We recommend that you check each type of node multiple times to confirm that different types of nodes can run as expected.

Check whether the time zone for scheduling is changed

You can go to the Properties tab of a desired node in DataStudio to check whether the time zone for scheduling is changed and view the current time zone for scheduling.

  1. Go to the DataStudio page.

    Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose Data Development and Governance > Data Development. On the page that appears, select the desired workspace from the drop-down list and click Go to Data Development.

  2. Go to the Properties tab.

    1. On the DataStudio page, find the desired node and go to the configuration tab of the node.

    2. On the configuration tab of the node, click Properties in the right-side navigation pane.

  3. On the Properties tab, view the current time zone for scheduling in the Schedule section.

Appendix: Processing of time information related to Data Integration

The time zone of Data Integration is irrelevant to the time zone for scheduling in DataWorks. The replacement values of scheduling parameters of a node are issued to Data Integration as strings. For example, gmt_modify >= ${yyyymmdd} in the code of a node indicates that the SQL statement with the WHERE clause used for data filtering is executed to issue string literals to the related data source for processing. The data filtering effect is limited by the time zone processing mechanism of the data source.

Important

The time zone for the synchronization process in Data Integration is the same as the time zone of the region where the current DataWorks workspace resides. The time zone for the synchronization process does not vary based on the change in the time zone for scheduling in DataWorks. However, data synchronization of specific data sources is relevant to the time zone for the synchronization process. Take note of the relationship between the time zone for the synchronization process and the time zone for scheduling.