npawar opened a new pull request #5430:
URL: https://github.com/apache/incubator-pinot/pull/5430


   Still a WIP, not ready for review.
   Handles cases like
   ```
   {
    "orderNumber": 100,
    "orderTime": "2019-08-10",
    "payload": {
      "lineItems": [
        {
          "itemNumber": 300,
          "price" : 400
        },
        {
          "itemNumber": 3,
          "price" : 55
        },
        {
          "itemNumber": 1,
          "price" : 3333
        }
      ]
    }
   }
   
   ```
   getting converted to multiple records in Pinot
   ```
   { "orderNumber": 100, "orderTime": "2019-08-10" "itemNumber": 300, "price" : 
400},
   { "orderNumber": 100, "orderTime": "2019-08-10" "itemNumber": 3, "price" : 
55},
   { "orderNumber": 100, "orderTime": "2019-08-10" "itemNumber": 1, "price" : 
3333}
   ```
   For batch, set in job spec yml file
   ```
   recordReaderSpec:
     dataFormat: 'json'
     className: 'org.apache.pinot.plugin.inputformat.json.JSONRecordReader'
     configClassName: 
'org.apache.pinot.plugin.inputformat.json.JSONRecordReaderConfig'
     configs:
         flattenJsonPath: "\$.payload.lineItems[*]"
   ```
   For stream, set in streamConfig's decoder properties
   ```
   "stream.kafka.decoder.class.name": 
"org.apache.pinot.plugin.stream.kafka.KafkaJSONMessageDecoder",
   "stream.kafka.decoder.prop.flattenJsonPath": "$.payload.lineItems[*]",
   
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to