Skip to content

Latest commit

 

History

History

json-transformation-functions

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

JSON Transformation Functions

In this recipe we'll learn how to use JSON transformation functions to extract values from nested JSON documents.

Pinot Version 1.0.0
Schema config/schema.json
Table Config config/table.json
Ingestion Job config/job-spec.yml

This is the code for the following recipe: https://dev.startree.ai/docs/pinot/recipes/json-transformation-functions


Clone this repository and navigate to this recipe:

git clone [email protected]:startreedata/pinot-recipes.git
cd pinot-recipes/recipes/json-transformation-functions

Spin up a Pinot cluster using Docker Compose:

docker compose up

Open another tab to add the people table:

docker run \
   --network json \
   -v $PWD/config:/config \
   apachepinot/pinot:1.0.0 AddTable \
     -schemaFile /config/schema.json \
     -tableConfigFile /config/table.json \
     -controllerHost "pinot-controller-json" \
    -exec

Import data/ingest.json into Pinot:

docker run \
   --network json \
   -v $PWD/config:/config \
   -v $PWD/data:/data \
   apachepinot/pinot:1.0.0 LaunchDataIngestionJob \
    -jobSpecFile /config/job-spec.yml

Navigate to http://localhost:9000/#/query and run the following query:

select * 
from people 
limit 10