CCAAK practice question 12 of 15
Which ksqlDB statement produces data that is persisted into a Kafka topic?
Full set: 54 questionsThe INSERT INTO ... VALUES statement is a Data Manipulation Language (DML) command in ksqlDB used to produce a single row of data into an existing stream. Since every ksqlDB stream is backed by a Kafka topic, executing this statement directly results in a new message being produced and durably persisted to that underlying topic. This is the primary method for inserting individual, ad-hoc records into a stream from the ksqlDB CLI or an application.
A. SELECT (Pull Query): This query retrieves the current state from a materialized table at a specific point in time. It reads data; it does not write new data to a topic.
B. SELECT (Push Query): This is a continuous query that streams results to the client as new events arrive. It does not, by itself, persist its output to a new Kafka topic.
D. CREATE TABLE: This is a Data Definition Language (DDL) statement that defines the schema and properties of a table. It sets up structure but does not insert data records.
1. Confluent Documentation, ksqlDB SQL Reference, INSERT INTO: "Use the INSERT INTO statement to insert a row into an existing stream. The inserted row is published to the underlying Kafka topic of the stream."
Source: Confluent, Inc. (2023). ksqlDB Documentation: INSERT INTO. Retrieved from https://docs.ksqldb.io/en/latest/developer-guide/ksqldb-reference/insert-into/
2. Confluent Documentation, ksqlDB Concepts, Queries: "ksqlDB supports two types of queries: pull queries and push queries... A pull query is a SELECT query that fetches a result and terminates... A push query is a SELECT query that emits a continuous stream of updates."
Source: Confluent, Inc. (2023). ksqlDB Documentation: Queries. Retrieved from https://docs.ksqldb.io/en/latest/concepts/queries/
3. Confluent Documentation, ksqlDB SQL Reference, CREATE TABLE: "Use the CREATE TABLE statement to create a new table from an existing Kafka topic, or to create a new table and a corresponding new Kafka topic." (Note: This describes the creation of the structure, not the insertion of data rows).
Source: Confluent, Inc. (2023). ksqlDB Documentation: CREATE TABLE. Retrieved from https://docs.ksqldb.io/en/latest/developer-guide/ksqldb-reference/create-table/
Keep practicing
Take the free CCAAK practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CCAAK practice questions
- Question 1When a broker goes down, what will the Controller do?
- Question 2A developer is working for a company with internal best practices that dictate that there…
- Question 3A company is setting up a log ingestion use case where they will consume logs from numero…
- Question 4If the Controller detects the failure of a broker that was the leader for some partitions…
- Question 5Where are Apache Kafka Access Control Lists stored'?
- Question 6Which tool is used for scalably and reliably streaming data between Kafka and other data …
