saurabhd336 opened a new pull request, #12748:
URL: https://github.com/apache/pinot/pull/12748

   https://github.com/apache/pinot/pull/12532 added support for extracting 
multi value json fields using `jsonExtractIndex`. The default value was always 
an empty array `[]`. This PR enhances the functionality by allowing users to 
specify any arbitrary array default value.
   
   Eg:
   ```
   {
       "stringField": "xyz",
       "arrField": [{"f1": 1, "f2": 2}, {"f1": 3, "f2": 4}, {"f2": 6}]
   }
   ```
   `jsonExtractIndex(jsonField, '$.arrField[*].f1', 'INT_ARRAY')` returns `[1, 
3]` for this row
   `jsonExtractIndex(jsonField, '$.arrField[*].f2', 'INT_ARRAY')` returns `[2, 
4, 6]` for this row 
   
   `jsonExtractIndex(jsonField, '$.arrField[*].f5', 'INT_ARRAY', '[]')` returns 
`[]` for this row (Default value since `$.arrField[*].f5` doesn't exist)
   `jsonExtractIndex(jsonField, '$.arrField[*].f5', 'INT_ARRAY', '[1, 2, 3]')` 
returns `[1, 2, 3]`
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to