Streaming read from a topic
You can read data from a topic using a regular SELECT without creating a streaming query. To do this, specify STREAMING = "TRUE" in the WITH block and set a limit on the number of output rows via LIMIT; otherwise, the query will 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
- Debug reads from a topic — recipe with additional examples
- Streaming queries
- CREATE STREAMING QUERY
Was the article helpful?
Previous
Next