Categories:

Information Schema , Table Functions

TASK_DEPENDENTS

This table function returns the list of child tasks for a given root (i.e. parent) task in a simple tree of tasks.

Syntax

TASK_DEPENDENTS(
      TASK_NAME => '<string>'
      [, RECURSIVE => <Boolean> ] )

Arguments

TASK_NAME => 'string'

A string specifying a task. The function returns the specified root task as the first entry, followed by the list of child tasks.

  • Note that the entire name must be enclosed in single quotes, including the database and schema (if the name is fully-qualified), i.e. '<db>.<schema>.<stream_name>'.

  • If the stream name is case-sensitive or includes any special characters or spaces, double quotes are required to process the case/characters. The double quotes must be enclosed within the single quotes, i.e. '"<stream_name>"'.

RECURSIVE => Boolean

Specifies whether to limit the output to include only direct child tasks or to include all recursive child tasks.

Values

TRUE: Returns all recursive child tasks (children, grandchildren, etc.) in the output.

FALSE: Returns only direct child tasks in the output.

Default: TRUE.

Usage Notes

  • Returns results only for the ACCOUNTADMIN role or the task owner (i.e. the role with the OWNERSHIP privilege on the task).

  • When calling an Information Schema table function, the session must have an INFORMATION_SCHEMA schema in use or the function name must be fully-qualified. For more details, see Information Schema.

Output

The function output provides table properties and metadata in the following columns:

| created_on | name | database_name | schema_name | comment | warehouse | schedule | state | definition | condition

Column

Description

created_on

Date and time when the task was created.

name

Name of the task.

database_name

Database for the schema for the task.

schema_name

Schema for the task.

owner

Role that owns the task (i.e. has the OWNERSHIP privilege on the task)

comment

Comment for the task.

warehouse

Warehouse that provides the required resources to run the task.

schedule

Schedule for running the task. Displays NULL if no schedule is specified.

predecessor

Task that triggers this task when run successfully. Displays NULL if no predecessor task is specified.

state

‘Started’ or ‘Suspended’ based on the current state of the task.

definition

SQL statements executed when the task runs.

condition

Condition specified in the WHEN clause for the task.

Examples

Retrieve the list of direct child tasks for the mydb.myschema.mytask task:

select *
  from table(information_schema.task_dependents(task_name => 'mydb.myschema.mytask', recursive => false));