Hi all, when pinot to consuming kafka , how to pa...
# general
c
Hi all, when pinot to consuming kafka , how to parse nest json such like { “data”: { “name”: “cc”, “age”: 3 } } I just need “name” and age in table
t
You have to define
name
and
age
in schemaConfig. After that, You need to use the json inbuilt functions in the transform config to extract those fields.
Copy code
"transformConfigs": [
        {
          "columnName": "merchant_id",
          "transformFunction": "jsonPathString(data, '$.name')"
        }]
This is an example to extract name from the field data.
c
And then i need to use json functions during query time
t
You won’t have to. Once you have defined transformConfigs during ingestion, you would be able to select the fields directly.
Copy code
select name from your_table
c
Ok ,thx ,if this method will not have good performance compare to flatten json
Like you wiki writed
image.png
t
If you are ingesting it as a string you can use those functions during query time. Else you can extract them during ingestion itself.