Reputation: 938
I have created a ksql stream using
CREATE STREAM basic_streams (data VARCHAR) \
WITH (KAFKA_TOPIC='main-topic',VALUE_FORMAT='JSON');
I have a producer running, pumping data into the stream. Is it possible to list/show the most recent items sent to the ksql stream?
Thanks
P.S. I tried in ksql server and the results are
ksql> list streams;
Stream Name | Kafka Topic | Format
---------------------------------------------------
BASIC_STREAMS | main-topic | JSON
---------------------------------------------------
ksql> PRINT main-topic;
Could not find topic 'MAIN-TOPIC', KSQL uses uppercase.
To print a case-sensitive topic apply quotations, for example: print 'topic';
and when i tried
ksql> print 'main-topic';
it hangs there forever
Upvotes: 2
Views: 3177
Reputation: 1893
You can run:
PRINT 'main-topic' FROM BEGINNING;
to see all rows in topic.PRINT main-topic;
in more recent versions of ksqlDB as the topic name is case-sensitiveSELECT * FROM basic_streams;
to achieve the same in a more SQL way.Upvotes: 1