DESCRIBE QUERY STATE

Syntax

DESCRIBE QUERY STATE [query_id | query_name[:query_version]];

Description

This command provides a snapshot of the source Relations' position in a terminated 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.

query_name

This is the name of the Query to describe. See LIST QUERIES to find out how to list all Queries that the user has access to. The column (Name) in the response corresponds with the query_name. The query_version property disambiguates between multiple queries with the same name.

query_version

This is the version of the Query to describe. See LIST QUERIES to find out how to list all Queries that the user has access to. The column (Version) in the response corresponds with the query_version. If query_name is provided without a query_version, the latest query_version will be used.

Examples

State for an active Query

The following example shows that an active query does not report any state information:

demodb.public/demostore# DESCRIBE QUERY STATE 24f5a97b-97e9-40eb-8dbf-431b96474972;
+----------------+-------------+-------+
|  Relation Name |  Store Type |  Info |
+================+=============+=======+
+----------------+-------------+-------+

demodb.public/demostore# DESCRIBE QUERY STATE demoquery:1;
+----------------+-------------+-------+
|  Relation Name |  Store Type |  Info |
+================+=============+=======+
+----------------+-------------+-------+

State for a terminated Query

The following example shows that the described query was operating on a sinle source, demodb.public.pagevviews, in a Store of type Kafka, and was at the offset 28899068 in partiion 0 when the Query was terminated:

demodb.public/demostore# DESCRIBE QUERY STATE 24f5a97b-97e9-40eb-8dbf-431b96474972;
+---------------------------+-------------+-----------------------------+
|  Relation Name            |  Store Type |  Info                       |
+===========================+=============+=============================+
| demodb.public.pagevviews  | KAFKA       | partition:0,offset:28899068 |
+---------------------------+-------------+-----------------------------+

demodb.public/demostore# DESCRIBE QUERY STATE demoquery:1;
+---------------------------+-------------+-----------------------------+
|  Relation Name            |  Store Type |  Info                       |
+===========================+=============+=============================+
| demodb.public.pagevviews  | KAFKA       | partition:0,offset:28899068 |
+---------------------------+-------------+-----------------------------+

Last updated