Pinot Version | 0.9.3 |
---|---|
Code | startreedata/pinot-recipes/json-transformation-functions |
subjects
and grades
columns will both contains arrays of values, which we can configure by setting "singleValueField":false
.
We’ll also have the following table config:
ingestionConfig.transformConfigs
) to extract the subject names and grades from the subjectAndGrades
property, using the jsonPathArray function. We also define one to extract the age
from the meta
property using the JSONPATHLONG function.
You can create the table and schema by running the following command:
people
schema. If one of the fields doesn’t exist in the schema it will be skipped.
In this case the name
field will be automatically mapped to the name
column. The subjectAndGrades
field is processed by transformation functions and the values are imported into the subjects
and grades
columns. The meta
field is processed by a transformation function to extract the age
property, which is stored in the age
column.
You can run the following command to run the import:
people
table or copy/paste the following query:
age | grades | name | subjects |
---|---|---|---|
24 | A,B | Pete | Maths,English |
28 | A,C | John | Maths,Computer Science |