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

   
   
   ### Description
   This PR modifies Druid native filters to correctly observe SQL [three-valued 
logic](https://en.wikipedia.org/wiki/Three-valued_logic) (`true`, `false`, 
`unknown`) instead of Druids classic two-state logic whenever 
`druid.expressions.useStrictBooleans` is set to true and 
`druid.generic.useDefaultValueForNull` is false (both the defaults in upcoming 
Druid 28).
   
   The most prominent example of what is fixed by this is something like the 
following query
   
   <img width="584" alt="Screenshot 2023-09-07 at 8 30 52 PM" 
src="https://github.com/apache/druid/assets/1577461/a16d34bc-08f3-4310-906f-6a25fd5bb5a2";>
   
   which prior to this change would incorrect match null values, but after 
behaves in SQL compliant fashion and only matches actual values:
   
   <img width="609" alt="Screenshot 2023-09-07 at 8 29 46 PM" 
src="https://github.com/apache/druid/assets/1577461/b4fb2d17-51e7-412b-ae41-74c569ade383";>
   
   This change has only been done in SQL compatible/strict boolean mode to be 
consistent with the behavior of Druids native expressions, which already using 
the correct tri-state logic system if these flags were in place.
   
   #### Release note
   tbd
   
   <hr>
   
   This PR has:
   
   - [ ] been self-reviewed.
      - [ ] using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] 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