DESCRIBE QUERY HISTORY

Syntax

DESCRIBE QUERY HISTORY query_id;

Description

This command provides a history of instances of a Streaming or Continuous Query created in the current Organization.

See Query on how streaming queries operate in DeltaStream.

The Query will only be visible if the current role has USAGE privileges.

Arguments

query_id

This is the unique identifier of the Query to describe. See LIST QUERIES to find out how to list all Queries that the user has access to. The first column (ID) in the response corresponds with the query_id.

Examples

Describe a Query when running and stopped

demodb.public/demostore# DESCRIBE QUERY HISTORY 24f5a97b-97e9-40eb-8dbf-431b96474972;
+---------+-------------------------------+-------------+-----------+
|  State  |  Created At                   |  Stopped At |  Messages |
+=========+===============================+=============+===========+
| RUNNING | 2024-07-09 16:52:15 +0000 UTC | <null>      |           |
+---------+-------------------------------+-------------+-----------+
demodb.public/demostore# DESCRIBE QUERY HISTORY 24f5a97b-97e9-40eb-8dbf-431b96474972;
+---------+-------------------------------+-------------------------------+-----------+
|  State  |  Created At                   |  Stopped At                   |  Messages |
+=========+===============================+===============================+===========+
| STOPPED | 2024-07-09 16:52:15 +0000 UTC | 2024-07-09 16:58:20 +0000 UTC |           |
+---------+-------------------------------+-------------------------------+-----------+

Describe an errored Query

The following example shows a Query with multiple instances attempting to recover from an issue at Query runtime, and terminating in an ERRORED state in the last instance:

testdb.public/internal_stage# DESCRIBE QUERY HISTORY 142ecf31-bc8d-496b-bd0b-28ebb4a8757e;
+---------+-------------------------------+-------------------------------+-------------------+
|  State  |  Created At                   |  Stopped At                   |  Messages         |
+=========+===============================+===============================+===================+
| ERRORED | 2024-06-19 12:31:51 +0000 UTC | 0001-06-19 13:01:37 +0000 UTC | <error_message>   |
+---------+-------------------------------+-------------------------------+-------------------+
| ERRORED | 2024-06-18 18:17:42 +0000 UTC | 2024-06-19 12:31:49 +0000 UTC | <error_message>   |
+---------+-------------------------------+-------------------------------+-------------------+
| ERRORED | 2024-06-17 17:02:37 +0000 UTC | 2024-06-18 18:17:40 +0000 UTC | <error_message>   |
+---------+-------------------------------+-------------------------------+-------------------+

Last updated