Click to copy

• Reviewed for ksqlDB 0.29

How to Get Statement Used to Create a Table in ksqlDB

To know what statement created a particular table, use the DESCRIBE EXTENDED statement:

DESCRIBE scores_table EXTENDED;

and look for the Statement label in the first block below Kafka topic:

Name            : SCORES_TABLE
Type            : TABLE
Timestamp field : Not set - using <ROWTIME>
Key format      : KAFKA
Value format    : JSON
Kafka topic     : scores_topics (partitions: 10, replication: 3)
Statement       : CREATE SOURCE TABLE SCORES_TABLE (STUDENT_ID BIGINT PRIMARY KEY, NAME STRING, SCORE DOUBLE) WITH (KAFKA_TOPIC='scores_topics', KEY_FORMAT='KAFKA', VALUE_FORMAT='JSON');

You can see there that the last line shows the CREATE TABLE statement.

Discover what readers are saying
topictale
Get easy to digest how-tos on ksqlDB
Sign up
Please read our Privacy Policy to understand how we protect and manage your data.
You may also like