Click to copy
Tables • 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.
Was this article helpful?