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 data about people. It uses the Faker library, so you’ll first need to install that: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:
So we are including all fields in the JSON index.
Fields included in the JSON index can be filtered using the
JSON_MATCH function.
If you use this function with a field that isn’t included in the index, it won’t return any records.Querying by JSON index
Let’s now try to query this table using the JSON index. JSON indexes support the following predicates:=, <>, IN, and NOT IN
Query Results
And one more:
Query Results
Updating JSON index
Now let’s say we want to update the config of the JSON index so that not all fields are indexed. At the moment this must be done in the following steps:- Update the table config to remove the index completely.
- Refresh all segments.
- Update the table config with the new config.
- Refresh all segments.
AddTable command with the following table config:
age, any array fields (i.e interests or friend_ids), or address.street_address.
Let’s apply that config
Query Results
This field isn’t indexed anymore, so we don’t get any results.
Same thing if we search by street address:
Query Results
But we can still search by country:
Query Results

