clintropolis commented on a change in pull request #10613:
URL: https://github.com/apache/druid/pull/10613#discussion_r578985027
##########
File path:
processing/src/main/java/org/apache/druid/query/filter/DruidPredicateFactory.java
##########
@@ -27,6 +27,13 @@
{
Predicate<String> makeStringPredicate();
+ default Predicate<Object> makeObjectPredicate()
+ {
+ // default to try to use string predicate;
+ final Predicate<String> stringPredicate = makeStringPredicate();
+ return o -> stringPredicate.apply((String) o);
Review comment:
So, I agree that String objects should just use the string predicate,
but I also liked the idea of having an object predicate so that we can
potentially match array types and possibly complex types.
I've modified the default implementation of object predicate to instead
mimic the behavior of the `NilVectorValueMatcher` predicate, which supplied
null to the string predicate.
`VectorValueMatcherColumnProcessorFactory.makeObjectProcessor ` now checks
the type, and uses either `StringObjectVectorValueMatcher` which always uses
the string predicate, or `ObjectVectorValueMatcher` which calls the object
predicate, and so has the behavior of the `NilVectorValueMatcher`.
----------------------------------------------------------------
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]