clintropolis opened a new pull request #11270:
URL: https://github.com/apache/druid/pull/11270


   ### Description
   This PR fixes an issue with expression evaluation for array value bindings 
when input is provided by JSON deserialized values (rather than parsing a 
constant or provided by a column for example), such as when results are being 
merged on a broker.
   
   The main issue is that an empty array result from a historical is later 
deserialized from JSON into an empty ArrayList, which 
`ExprEval.coerceListToArray` converts into `Object[0]`, but 
`ExprEval.bestEffortOf` is unable to handle this. This PR fixes the issue by 
treating this empty list as an empty string array (since string array is the 
default in the other cases of this method, as strings are traditionally the 
more flexible type in druid)
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [x] been tested in a test Druid cluster.
   


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