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

   ### Description
   Fixes a bug with nested column range index value range computation that can 
lead to incorrect values matching filters when the range is not present in the 
nested fields local dictionary.
   
   This PR fixes the issue by checking that the computed local start and end 
index values global id mapping does not violate the computed original global id 
range whenever the actual global ids are not present in the local dictionary. 
That's a lot of words thats probably hard to follow, but its basically an off 
by 1 error when mapping the global range to the local range in certain cases.
   
   This wrong behavior was accidentally encoded in a test I wrote which would 
have caught the issue if the test had been expecting the correct answer, so I 
went through and manually verified that the tests are _actually_ expecting the 
correct thing this time, as well as tried to get 100% coverage on everything 
which matters in practice, which is now pretty high
   <img width="649" alt="Screen Shot 2022-11-02 at 2 08 41 AM" 
src="https://user-images.githubusercontent.com/1577461/199449776-0d45da86-0bf1-451a-8159-48f0cc2a402a.png";>
   
   The remaining uncovered lines are largely things like safety checks that are 
not hit in regular operation such as calling next on an iterator before calling 
hasNext, etc, which I cannot hit during normal usage of the index supplier.
   
   
   #### Release note
   Fixes a bug with nested columns when using filters that use range indexes 
such as greater/less than or like filters.
   
   <hr>
   
   This PR has:
   
   - [ ] been self-reviewed.
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in 
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] 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.
   - [ ] added integration tests.
   - [ ] 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