clintropolis commented on code in PR #12995:
URL: https://github.com/apache/druid/pull/12995#discussion_r964034394
##########
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:
reworked things a bit, added a new interface `NamedFunction`, which
`Function`, `ApplyFunction` and `ExprMacro` all extend and which defines all of
these validation helper methods so they can be shared
--
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]