Streaming SQL

Streaming SQL supports real-time SQL queries and continuous result updates based on shared tables. Users can declare tables as the input, register streaming SQL queries, subscribe to real-time results, and manage the query lifecycle. The streaming SQL feature is suitable for low-latency analysis of data such as real-time market data and monitoring metrics. The related functions are listed below:

Function Description
declareStreamingSQLTable Declare a specified table as an the input streaming SQL table. Only declared tables can be used to register streaming SQL queries. Declaration does not affect the table's use in regular SQL operations.
getStreamingSQLStatus Query the status of streaming SQL queries, supporting retrieval of a single query or all queries. The admin can view queries from all users.
listStreamingSQLTables List all streaming SQL tables declared by the current user. The admin can view declarations from all users. The returned table contains the table name, shared status, and list of declaring users.
registerStreamingSQL Register a streaming SQL query and return a query ID, and automatically create a result change log stream table. Supports keywords such as SELECT, WHERE, JOIN (only equality joins are supported, and only for types ej, lj, rj, fj), and ORDER BY.
revokeStreamingSQL Revoke the registered streaming SQL query.
revokeStreamingSQLTable Revoke the declared streaming SQL query table. Revoke all streaming SQL queries on the table before revoking the table. Only the table declared by the current user can be revoked. Only removes the streaming SQL feature; the table and its data remain.
subscribeStreamingSQL Subscribe to the results of a specified streaming SQL query. The subscriber executes the query and maintains a shared result table that is updated in real time.
unsubscribeStreamingSQL Unsubscribe from the results of a specified streaming SQL query. The subscriber's real-time result table stops updating.