clintropolis opened a new pull request, #14654: URL: https://github.com/apache/druid/pull/14654
### Description Fixes some bugs with the new equality and range filters when matching double typed values (and arrays) to long typed columns (and arrays). These filters specify a match value type, which is used to help coerce values to the underlying input type, typically by casting them. This is important because we want to ideally change the match value to the native input type so that we don't instead have to cast every row value we want to match into the match value type. However, for matching double values to long inputs, this can lead to precision loss from the type narrowing, resulting in problems such as `1L` matching `1.1` since the latter becomes `1` when cast to a long. A similar problem happens with range filters. We still want to allow something like `1.0` to match `1L`, since they are equivalent. The solution, is to check if this narrowing violates equality, and: * for equality filters, spit out an 'all false' result * for range filters, take the ceiling of the double value if the lower bound is closed, or floor if open, and the floor of the double value if the upper bound is closed, or ceiling if open This corrects the behavior, making matchers behave as expected. I also fixed an issue with 'auto' typed numeric columns, which were incorrectly reporting themselves as dictionary encoded in the `ColumnCapabilities`, which .. they are actually dictionary encoded, however they do not implement `DictionaryEncodedColumn`, which causes some class cast exceptions in places which expect that all columns which make the claim on their capabilities can produce dimension selectors, and these columns currently can not. <hr> This PR has: - [x] been self-reviewed. - [x] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. - [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]
