Prerequisites
To follow the code examples in this guide, you must install Docker locally and download recipes.Navigate to recipe
- If you haven’t already, download recipes.
- In terminal, go to the recipe by running the following command:
Launch Pinot Cluster
You can spin up a Pinot Cluster by running the following command:Data generator
This recipe contains a data generator that creates events with a timestamp, count, and UUID. You can generate data by running the following command:Kafka ingestion
We’re going to ingest this data into an Apache Kafka topic using the kcat command line tool. We’ll also usejq to structure the data in the key:payload structure that Kafka expects:
Pinot Schema and Table
Now let’s create a Pinot Schema and Table. First, the schema:Querying by segment
Once that’s been created, we can head over to the Pinot UI and run some queries. Pinot has several built-in virtual columns inside every schema that can be used for debugging purposes:
The one that’s useful for us is
$segmentName, which we can use like this to count the number of records in each segment:
Query Results
We can then pick one of those segments and see what records are stored in that segment:
Query Results

