getStreamingSQLSubscriptionInfo
Syntax
getStreamingSQLSubscriptionInfo(queryId)
Details
Retrieves the metadata of a specified Streaming SQL query.
Parameters
queryId is a string indicating the ID of a streaming SQL query.
Returns
A dictionary with the following keys:
-
leadingRecordInsertTime: the insertion time of the earliest inserted row among the data that triggered the most recent update.
-
lastRecordInsertTime: the insertion time of the latest inserted row among the data that triggered the most recent update.
-
lastUpdatedTime: the time when the current result set was updated.
Examples
// declare tables as the input tables of streaming SQL
share keyedTable(`id, 1:0, `id`value, [INT, DOUBLE]) as leftTable;
share keyedTable(`id, 1:0, `id`value, [INT, DOUBLE]) as rightTable;
go;
declareStreamingSQLTable(leftTable);
declareStreamingSQLTable(rightTable);
// register a streaming SQL query
queryId = registerStreamingSQL("select id, leftTable.value + rightTable.value from leftTable left join rightTable on leftTable.id=rightTable.id");
// subscribe to the results of the streaming SQL query
result = subscribeStreamingSQL(,queryId)
t = table(1 2 3 4 5 as id, 0.1 0.2 0.3 0.4 0.5 as value);
leftTable.append!(t);
t = table(1 2 3 4 5 as id, 0.1 0.2 0.3 0.4 0.5 as value)
rightTable.append!(t)
// retrieves the metadata of the Streaming SQL query
getStreamingSQLSubscriptionInfo(queryId)
/*
output:
leadingRecordInsertTime->2026.01.29T17:42:08.297
lastRecordInsertTime->2026.01.29T17:42:08.297
lastUpdateTime->2026.01.29T17:42:08.297
*/
