clintropolis commented on code in PR #14654:
URL: https://github.com/apache/druid/pull/14654#discussion_r1274179461


##########
processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:
##########
@@ -644,6 +644,27 @@ public static Number computeNumber(@Nullable String value)
     return rv;
   }
 
+  /**
+   * Returns true if an {@link ExprEval} which has been cast to some other 
type is not equal to the original type.
+   * Effectively, this only happens with casts to {@link ExpressionType#LONG} 
and {@link ExpressionType#LONG_ARRAY}.

Review Comment:
   That's a good point, I guess I was focused on casting to longs, and was 
having some trouble coming up with a name.
   
   I've reworked things a bit and now the method is actually doing the casting, 
`ExprEval.castForComparison`, and is used more widely for building value 
matchers/predicates so if we decide to check for other things that should 
result in short-circuit of equality comparison we won't have to do much other 
than update this method. I think this probably fixed a few problems with 
equality filters with string match value types that are not convertible to 
numbers, but I haven't added tests yet. I have not wired this method up for 
range filters though, because at least for the double to long case, we can 
still do comparison, just not directly with the cast values. I need to think a 
bit more about this. Maybe i should put 'equality' in the method name since 
that is the only comparison it is currently used for?



-- 
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: commits-unsubscr...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to