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:Dataset
We’re going to import the following JSON file:showLineNumbers
Ratings property of each movie. We’re going to unnest or explode the ratings so that we have one row per rating in our database after the data is ingested.
Pinot Schema and Table
Now let’s create a Pinot Schema and Table. First, the schema:Ratings.
We’ll also have the following table config:
Ratings field contains an array of JSON objects and that array will be exploded to create one row for each item in the array.
If you want to rename the unnested fields, see How to rename fields when unnesting arrays in JSON documents
Ingestion Job
Now we’re going to import the JSON file into Pinot. We’ll do this with the following ingestion spec:movie_ratings schema. If one of the fields doesn’t exist in the schema it will be skipped.
You can run the following command to run the import:
Querying
Once that’s completed, navigate to localhost:9000/#/query and click on themovie_ratings table or copy/paste the following query:
Query Results
We can see that each movie has multiple rows, one for each rating given to that movie.

