- Categories:
SYSTEM$TASK_RUNTIME_INFO¶
Returns information about the current task run. If this function is called outside of a task run, it fails with an error.
Syntax¶
Arguments¶
'arg_name'Specifies the type of information to return. You can specify one of the following values:
Value
Description
'CURRENT_TASK_NAME'Returns the name of the current task.
'CURRENT_ROOT_TASK_NAME'Returns the name of the root task in the current task graph.
'CURRENT_ROOT_TASK_UUID'Returns a universally unique identifier (UUID) that represents the root task in the current task graph.
'CURRENT_TASK_GRAPH_RUN_GROUP_ID'Returns a universally unique identifier (UUID) that represents the current graph run group.
'CURRENT_TASK_GRAPH_ORIGINAL_SCHEDULED_TIMESTAMP'Returns the original scheduled timestamp of the root task in the current graph run group.
For graphs that are retried, the returned value is the original scheduled timestamp of the initial graph run in the current group.
'LAST_SUCCESSFUL_TASK_GRAPH_RUN_GROUP_ID'Returns a universally unique identifier (UUID) that represents the latest successful graph run group.
The value is consistent throughout the graph run group and is determined when the root task of the initial graph run starts.
'LAST_SUCCESSFUL_TASK_GRAPH_ORIGINAL_SCHEDULED_TIMESTAMP'Returns the original scheduled timestamp of the root task in the latest successful graph run group.
The value is consistent throughout the graph run group and is determined when the root task of the initial graph run starts.
Returns¶
Returns a STRING or TEXT with requested information.
Usage notes¶
We recommend using SELECT instead of CALL for SYSTEM$TASK_RUNTIME_INFO, because SELECT SYSTEM$TASK_RUNTIME_INFO automatically converts datatypes, while CALL SYSTEM$TASK_RUNTIME_INFO doesn’t.
Examples¶
Use CURRENT_TASK_GRAPH_RUN_GROUP_ID with CURRENT_ROOT_TASK_NAME for debugging and creating a unique output directory or file:
Use CURRENT_TASK_GRAPH_ORIGINAL_SCHEDULED_TIMESTAMP with LAST_SUCCESSFUL_TASK_GRAPH_ORIGINAL_SCHEDULED_TIMESTAMP to process data from streaming input source:
Use LAST_SUCCESSFUL_TASK_GRAPH_RUN_GROUP_ID to generate a unique output directory and log lines: