Streaming read from a topic

You can read from a topic with a regular SELECT without creating a streaming query. Set STREAMING = "TRUE" in the WITH block and limit output rows with LIMIT; otherwise the query does not complete.

Warning

This method is intended only for debugging and checking data in a topic. For production processes, create streaming queries using CREATE STREAMING QUERY.

Note

In the examples, ydb_source is a pre-created external data source, and topic_name is a topic available through it.

Example

SELECT
    Data
FROM
    ydb_source.topic_name
WITH (
    FORMAT = raw,
    SCHEMA = (
        Data String
    ),
    STREAMING = "TRUE"
)
LIMIT 1

See also