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 2022/09/01 00:18:13 UTC

[GitHub] [druid] clintropolis commented on a diff in pull request #12995: more consistent expression error messages

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


##########
core/src/main/java/org/apache/druid/math/expr/ApplyFunction.java:
##########
@@ -105,6 +103,44 @@ default boolean hasArrayOutput(LambdaExpr lambdaExpr)
    */
   void validateArguments(LambdaExpr lambdaExpr, List<Expr> args);
 
+  /**
+   * Check that the argument list is the expected size. The list of arguments should not include the
+   * {@link LambdaExpr} and so the error message will indicate that count + 1 arguments are required.
+   */
+  default void validateArgumentCount(LambdaExpr lambdaExpr, List<Expr> args, int count)

Review Comment:
   actually, thinking a bit more on this I'm going to look into making a common interface for `Function`, `ApplyFunction`, and `ExprMacro`, since they are all doing the same sort of role



-- 
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: commits-unsubscribe@druid.apache.org

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