gianm commented on code in PR #18503:
URL: https://github.com/apache/druid/pull/18503#discussion_r2356971051


##########
processing/src/main/java/org/apache/druid/math/expr/vector/FallbackVectorProcessor.java:
##########
@@ -368,7 +368,7 @@ public ExprEval eval(ObjectBinding bindings)
         final boolean isNull = results.getNullVector() != null && 
results.getNullVector()[rowNum];
         return ExprEval.ofDouble(isNull ? null : 
results.getDoubleVector()[rowNum]);
       } else {
-        return ExprEval.ofType(type, results.getObjectVector()[rowNum]);
+        return ExprEval.bestEffortOf(results.getObjectVector()[rowNum]);

Review Comment:
   I don't remember exactly which test failed, but the problem was that 
`ofType` doesn't coerce, it mostly trusts that the value you pass in is 
actually that type. But, there were some functions that lie about their output 
type (i.e. they return an expr that doesn't match the type from 
`getOutputType`), and to plug those in properly we need to coerce to the 
declared output type. I fixed a few in this patch but I'm not sure I got them 
all.



-- 
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