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

   ### Description
   Fixes a mistake in `NestedFieldLiteralColumnIndexSupplier` when creating 
`NullValueIndex`, where it was incorrectly always returning the bitmap for the 
first dictionary entry, instead of first confirming that this value is actually 
`null`. While the global value dictionary entry 0 is always null, within the 
local dictionary of the nested literal column, dictionary id must point to the 
global id 0 for the first bitmap entry to be the null value bitmap. If this is 
not the case, an empty bitmap should be used since the column contains no null 
values.
   
   This fixes queries using `IS NULL` or `IS NOT NULL` filters on nested 
columns that do not contain a null value in every segment, which presents as 
having a single value per segment matched and returned in the results
   
   <img width="446" alt="Screen Shot 2022-10-11 at 12 26 35 AM" 
src="https://user-images.githubusercontent.com/1577461/195030879-8adc489e-0bf4-400a-8f96-61f97a07533f.png";>
   <img width="353" alt="Screen Shot 2022-10-11 at 12 26 50 AM" 
src="https://user-images.githubusercontent.com/1577461/195030897-c89ff40c-d081-4108-865a-86a51a16d8a4.png";>
   
   <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.

To unsubscribe, e-mail: [email protected]

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