First Stream Ingest
Set up real-time streaming ingestion from Kafka and watch data arrive in Pinot.
Outcome
By the end of this page you will have a realtime Pinot table consuming data from a Kafka topic, with 12 rows visible in the query console.
Prerequisites
Completed First table and schema -- the
transcriptschema must already exist in the cluster.For Docker users: set the
PINOT_VERSIONenvironment variable. See the Version reference page.
Steps
1. Understand streaming ingestion
Streaming ingestion lets Pinot consume data from a message queue in real time. As messages arrive in a Kafka topic, Pinot reads them and makes the rows queryable within seconds. The realtime table config specifies the Kafka broker, topic, and decoder so that Pinot knows how to connect and interpret incoming records.
2. Start Kafka
Start Kafka on port 9876 using the same ZooKeeper from the Pinot quick-start:
bin/pinot-admin.sh StartKafka -zkAddress=localhost:2123/kafka -port 9876Kafka 4.0 runs in KRaft mode and does not require ZooKeeper:
docker run \
--network pinot-demo --name=kafka \
-e KAFKA_NODE_ID=1 \
-e KAFKA_PROCESS_ROLES=broker,controller \
-e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093 \
-e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092 \
-e KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER \
-e KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT \
-e KAFKA_CONTROLLER_QUORUM_VOTERS=1@kafka:9093 \
-e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \
-e CLUSTER_ID=MkU3OEVBNTcwNTJENDM2Qk \
-d apache/kafka:4.0.03. Create a Kafka topic
Download Apache Kafka if you have not already, then create the topic:
4. Save the realtime table config
Create the file /tmp/pinot-quick-start/transcript-table-realtime.json:
5. Upload the realtime table config
As soon as the realtime table is created, Pinot begins consuming from the Kafka topic.
6. Save the sample streaming data
Create the file /tmp/pinot-quick-start/rawdata/transcript.json:
7. Push data into the Kafka topic
Verify
Open the Query Console in your browser.
Run the following query:
You should see 12 rows of streaming data. Pinot ingests from Kafka in real time, so the rows appear within seconds of being pushed to the topic.
Next step
Continue to First query to learn how to write analytical queries against your Pinot tables.
Last updated
Was this helpful?

