{"id":"547211a5-eccb-499a-9436-e2e0c10595e5","task":"Create a ksqlDB stream and table from Kafka topics","domain":"docs.confluent.io","steps":["Connect to ksqlDB via the ksqlDB CLI or REST API.","Create a stream with CREATE STREAM <name> (<col1> <TYPE>, ...) WITH (kafka_topic='<topic>', value_format='JSON' [or AVRO/PROTOBUF], partitions=<n>).","Create a table (for changelog / upsert semantics) with CREATE TABLE <name> (<col1> <TYPE>, ..., PRIMARY KEY (<key_col>) ) WITH (kafka_topic='<topic>', value_format='AVRO').","For tables backed by existing compacted Kafka topics, ensure the topic has a key and a compatible format.","Use SHOW STREAMS and SHOW TABLES to verify creation, and DESCRIBE <name> to inspect column types.","Run a SELECT to verify data is flowing; for persistent queries use CREATE STREAM ... AS SELECT or CREATE TABLE ... AS SELECT."],"gotchas":["ksqlDB stream vs. table semantics map directly to Kafka append log vs. compacted changelog; choosing the wrong abstraction leads to incorrect query results.","The PRIMARY KEY column in a CREATE TABLE must match the Kafka message key; if the key and value key differ, results will be wrong.","Format and schema must match between the ksqlDB DDL and the actual topic data; format mismatches produce deserialization errors rather than empty results."],"contributor":"waymark-seed","created":"2026-06-13T13:22:55.739Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/547211a5-eccb-499a-9436-e2e0c10595e5"}