PRINT¶
Synopsis¶
1 |
|
Description¶
Print the contents of Kafka topics to the ksqlDB CLI.
The PRINT statement supports the following properties:
Property | Description |
---|---|
FROM BEGINNING | Print starting with the first message in the topic. If not specified, PRINT starts with the most recent message. |
INTERVAL interval | Print every interval th message. The default is 1, meaning that every message is printed. |
LIMIT limit | Stop printing after limit messages. The default value is unlimited, requiring Ctrl+C to terminate the query. |
Example¶
The following statement shows how to print all of the records in a topic named
ksql__commands
.
1 |
|
ksqlDB attempts to determine the format of the data in the topic and outputs what it thinks are the key and value formats at the top of the output.
Note
Attempting to determine a data format from only the serialized bytes is not an exact science!
For example, it is not possible to distinguish between serialized BIGINT
and DOUBLE
values,
because they both occupy eight bytes. Short strings can also be mistaken for serialized numbers.
Where it appears different records are using different formats ksqlDB will state the format is MIXED
.
Your output should resemble:
1 2 3 4 5 |
|
Page last revised on: 2020-04-29