Interface NamedFunction

    • Method Detail

      • name

        String name()
        Name of the function
      • validationHelperCheckArgumentCount

        default void validationHelperCheckArgumentCount​(List<Expr> args,
                                                        int count)
        Helper method for implementors performing validation to check if the argument count is expected
      • validationHelperCheckMinArgumentCount

        default void validationHelperCheckMinArgumentCount​(List<Expr> args,
                                                           int count)
        Helper method for implementors performing validation to check if there are at least as many arguments as specified
      • validationHelperCheckArgumentRange

        default void validationHelperCheckArgumentRange​(List<Expr> args,
                                                        int start,
                                                        int end)
      • validationHelperCheckAnyOfArgumentCount

        default void validationHelperCheckAnyOfArgumentCount​(List<Expr> args,
                                                             int... counts)
        Helper method for implementors performing validation to check if argument count is any of specified counts
      • validationHelperCheckArgIsLiteral

        default void validationHelperCheckArgIsLiteral​(Expr arg,
                                                       String argName)
        Helper method for implementors performing validation to check that an argument is a literal
      • validationHelperCheckArgumentCount

        default void validationHelperCheckArgumentCount​(org.apache.druid.math.expr.LambdaExpr lambdaExpr,
                                                        List<Expr> args,
                                                        int count)
        Helper method for implementors performing validation to check that the argument list is some expected size. The parser decomposes a function like 'fold((x, acc) -> x + acc, col, 0)' into the LambdaExpr '(x, acc) -> x + acc' and the list of arguments, ['col', 0], and so does not include the LambdaExpr here. To compensate for this, the error message will indicate that at least count + 1 arguments are required to count the lambda.
      • validationHelperCheckMinArgumentCount

        default void validationHelperCheckMinArgumentCount​(org.apache.druid.math.expr.LambdaExpr lambdaExpr,
                                                           List<Expr> args,
                                                           int count)
        Helper method for implementors performing validation to check that the argument list is at least some expected size. The parser decomposes a function like 'fold((x, acc) -> x + acc, col, 0)' into the LambdaExpr '(x, acc) -> x + acc' and the list of arguments, ['col', 0], and so does not include the LambdaExpr here. To compensate for this, the error message will indicate that at least count + 1 arguments are required to count the lambda.
      • validationHelperCheckLambaArgumentCount

        default void validationHelperCheckLambaArgumentCount​(org.apache.druid.math.expr.LambdaExpr lambdaExpr,
                                                             List<Expr> args)
        Helper method for implementors performing validation to check that the LambdaExpr.identifierCount() matches the number of arguments being passed to it