Pinot Version | 0.10.0 |
---|---|
Code | startreedata/pinot-recipes/ingest-json-files-kafka |
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 files:Pinot Schema and Table
Now let’s create a Pinot Schema and Table. First, the schema:smallest
means it will start from the earliest offset.
A value of largest
means it will start from the latest offset.
You can create the table and schema by running the following command:`
Importing data
Now we’re going to import the JSON files into Kafka:Querying
Once that’s completed, navigate to localhost:9000/#/query and click on themovies
table or copy/paste the following query:
boxOffice | budget | genre | releaseDate | title | year |
---|---|---|---|---|---|
216500000 | 52000000 | Comedy | 2010-02-12 00:00:00.0 | Valentine’s Day | 2010 |
205300000 | 38000000 | Comedy | 2010-04-14 00:00:00.0 | The Ugly Truth | 2009 |
156800000 | 30000000 | Romance | 2007-12-21 00:00:00.0 | P.S. I Love You | 2007 |
115000000 | 25000000 | Drama | 2010-04-14 00:00:00.0 | Dear John | 2010 |
335800000 | 167000000 | Fantasy | 2008-12-25 00:00:00.0 | The Curious Case of Benjamin Button | 2008 |
794881442 | 230000000 | Action | 2017-05-26 00:00:00.0 | Pirates of the Caribbean: Salazar’s Revenge | 2017 |
694394724 | 78000000 | Action | 2012-03-23 00:00:00.0 | The Hunger Games | 2012 |
121616555 | 28000000 | Romance | 2005-09-16 00:00:00.0 | Pride & Prejudice | 2005 |