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


##########
core/src/main/java/org/apache/druid/math/expr/vector/VectorProcessors.java:
##########
@@ -851,17 +861,19 @@ public void processIndex(
                 outputNulls[i] = true;
                 return;
               }
-              final boolean bool = Evals.asBoolean(rightInput[i]);
+              final boolean bool = Evals.asBoolean((String) rightInput[i]);
               output[i] = Evals.asLong(bool);
               outputNulls[i] = bool;
               return;
             } else if (rightNull) {
-              final boolean bool = Evals.asBoolean(leftInput[i]);
+              final boolean bool = Evals.asBoolean((String) leftInput[i]);

Review Comment:
   this safe because (for better or for worse) the base classes explicitly wrap 
their input processors with `CastToTypeVectorProcessor.cast` (which is a no-op 
if the processor is already the correct type) to ensure that it is being used 
with the correct type. I don't remember exactly why I did this, presumably 
because its important for vector processing that everything is the right type 
so we don't get ugly class cast exceptions, but I can look into if this is 
actually necessary or not.



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