imply-cheddar commented on code in PR #13803:
URL: https://github.com/apache/druid/pull/13803#discussion_r1148812003


##########
processing/src/main/java/org/apache/druid/math/expr/ExprEval.java:
##########
@@ -370,6 +370,18 @@ public static ExprEval ofComplex(ExpressionType 
outputType, @Nullable Object val
     return new ComplexExprEval(outputType, value);
   }
 
+  public static ExprEval bestEffortArray(@Nullable List<?> theList)
+  {
+    // do not convert empty lists to arrays with a single null element here, 
because that should have been done
+    // by the selectors preparing their ObjectBindings if necessary. If we get 
to this point it was legitimately
+    // empty
+    NonnullPair<ExpressionType, Object[]> coerced = coerceListToArray(theList, 
false);
+    if (coerced == null) {
+      return bestEffortOf(null);

Review Comment:
   Sure, I expected you to actually to create a method for `makeNullNode()` or 
something in `ExprEval` instead of newing it up directly here.  Just moving 
around the ordering of the statements is 🤷 .  Though, checking for `null` first 
is probably better than last.



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