Hi Everyone, Is there a way to indicate the actual...
# troubleshooting
a
Hi Everyone, Is there a way to indicate the actual data field for records read from kafka ? For example if I had records in Kafka like in below, would it be possible for Pinot to extract actual records from "employee" nested field?
Copy code
{
  "data": {
    "employee": {
      "name": "ali",
      "salary": 56000,
      "married": true,
      "messageTime": 1639652167
    }
  }
}
Example schema:
Copy code
{
  "schemaName": "employee",
  "dimensionFieldSpecs": [
    {
      "name": "name",
      "dataType": "STRING"
    },
    {
      "name": "salary",
      "dataType": "DOUBLE"
    },
    {
      "name": "married",
      "dataType": "BOOLEAN"
    }
  ],
  "metricFieldSpecs": [],
  "dateTimeFieldSpecs": [
    {
      "name": "messageTime",
      "dataType": "LONG",
      "format": "1:MILLISECONDS:EPOCH",
      "granularity": "1:MILLISECONDS"
    }
  ]
}
r
Hi @Ali Atıl you can use json path transforms to extract the values
here's some documentation on configuring transformations in ingestion: https://docs.pinot.apache.org/developers/advanced/ingestion-level-transformations#column-transformation
a
@Richard Startin Do you mean that I can apply column tranformations for each column?
r
take a look at transformConfigs in the first link
Copy code
"transformConfigs":[{"columnName" : "name", "transformFunction" : "jsonpath(data, '$.data.employee.name')}, ...
should do it
it would be a good idea to add a raw json column called
data
as well as the extracted attributes
a
@Richard Startin wow, i will try it asap. Thank you a lot))