NOTIFICATION_HISTORY table function: Changes to output (Pending)

Attention

This behavior change is in the 2024_04 bundle.

For the current status of the bundle, refer to Bundle History.

The NOTIFICATION_HISTORY function is changing to provide information about:

  • Notifications that have not yet been processed.

  • Attempts at sending notifications that have initially failed and that are being retried.

The next sections explain how these changes affect the output of the function:

Changes to the number of rows returned

The number of rows returned by the function is changing:

Before the change:

This function returns a row for each notification that has been processed (notifications that were either sent out or have failed).

If multiple attempts were made to send a notification, the function returns a row for the last attempt made.

After the change:

This function returns a row for each attempt at sending a notification. The value in the STATUS column indicates the status of the attempt:

  • If the attempt failed but can be retried, the value is RETRIABLE_FAILURE.

  • If the attempt failed and cannot be retried, the value is FAILURE.

  • If the attempt succeeded, the value is SUCCESS.

In addition, the function returns a row for each notification that has not yet been processed (notifications that are queued).

New columns in output

When this behavior change bundle is enabled, the output of the NOTIFICATION_HISTORY function includes the following new columns:

Column name

Data type

Description

ID

VARCHAR

Unique ID of a request to send a notification.

If Snowflake fails to send a notification and attempts to send the notification again, the function returns a row for each attempt. Each row for an attempt has the same value in the ID column but a different value in the ATTEMPT column.

ATTEMPT

INTEGER

Number of the attempt made to send the notification.

MESSAGE_SOURCE_INFO

OBJECT

Object containing information about the source of the notification. The fields in this object depend on the type of the source:

  • For error notifications for tasks, the object contains the following fields:

    • name: The name of the task.

    • graph_run_group_id: Identifier for the graph run.

    • attempt_number: Integer representing the number of the attempt to run this task.

  • For error notifications for Snowpipe, the object contains the pipe_name field, which specifies the name of the pipe.

  • For notifications sent by calling the SYSTEM$SEND_EMAIL stored procedure, the object contains the query_id field, which specifies the ID of the statement that called the stored procedure.

Deprecation of the MESSAGE column

The MESSAGE column is deprecated and will be removed in the future.

Ref: 1593