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:

For more information, see local and external topics in streaming queries.

Example

SELECT
    Data
FROM
    ext_source.input_topic -- or local topic input_topic
WITH (
    FORMAT = raw,
    SCHEMA = (
        Data String
    ),
    STREAMING = "TRUE"
)
LIMIT 1

See also