You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/05/19 20:05:56 UTC

[GitHub] [druid] jihoonson commented on a change in pull request #11270: fix issue with empty array converting to string expression instead of string array

jihoonson commented on a change in pull request #11270:
URL: https://github.com/apache/druid/pull/11270#discussion_r635548194



##########
File path: core/src/main/java/org/apache/druid/math/expr/ExprEval.java
##########
@@ -378,7 +378,7 @@ public static Object coerceListToArray(@Nullable List<?> val, boolean homogenize
       return new String[]{null};
     } else {
       if (val != null) {
-        return val.toArray();
+        return new String[0];

Review comment:
       nit: we can cache the instance of an empty array. A similar technique can be applied for the single element array of null above. I think we can do this as a follow-up.




-- 
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:
users@infra.apache.org



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