ccaominh commented on a change in pull request #8047: optimize single input column multi-value expressions URL: https://github.com/apache/incubator-druid/pull/8047#discussion_r309821049
########## File path: core/src/main/java/org/apache/druid/math/expr/Function.java ########## @@ -1801,24 +1830,30 @@ static void setArrayOutputElement( } + @Override + public Set<Expr> getScalarInputs(List<Expr> args) + { + return ImmutableSet.copyOf(args); + } + @Override public Set<Expr> getArrayInputs(List<Expr> args) { return Collections.emptySet(); } @Override - public void validateArguments(List<Expr> args) + public boolean hasArrayOutput() { - if (!(args.size() > 0)) { - throw new IAE("Function[%s] needs at least 1 argument", name()); - } + return true; } @Override - public Set<Expr> getScalarInputs(List<Expr> args) + public void validateArguments(List<Expr> args) { - return ImmutableSet.copyOf(args); + if (!(args.size() > 0)) { Review comment: Could simplify to: ```java if (args.isEmpty()) { ``` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org