Interface NamedFunction

All Known Subinterfaces:
ApplyFunction, ExprMacroTable.ExprMacro, Function
All Known Implementing Classes:
ApplyFunction.AllMatchFunction, ApplyFunction.AnyMatchFunction, ApplyFunction.BaseFoldFunction, ApplyFunction.BaseMapFunction, ApplyFunction.CartesianFoldFunction, ApplyFunction.CartesianMapFunction, ApplyFunction.FilterFunction, ApplyFunction.FoldFunction, ApplyFunction.MapFunction, ApplyFunction.MatchFunction, ArrayQuantileExprMacro, BuiltInExprMacros.ComplexDecodeBase64ExprMacro, BuiltInExprMacros.StringDecodeBase64UTFExprMacro, CaseInsensitiveContainsExprMacro, ContainsExprMacro, Function.Abs, Function.Acos, Function.ArrayAddElementFunction, Function.ArrayAppendFunction, Function.ArrayConcatFunction, Function.ArrayConstructorFunction, Function.ArrayContainsFunction, Function.ArrayLengthFunction, Function.ArrayOffsetFunction, Function.ArrayOffsetOfFunction, Function.ArrayOrdinalFunction, Function.ArrayOrdinalOfFunction, Function.ArrayOverlapFunction, Function.ArrayPrependFunction, Function.ArrayScalarFunction, Function.ArraySetAddAllFunction, Function.ArraySetAddFunction, Function.ArraysFunction, Function.ArraySliceFunction, Function.ArraysMergeFunction, Function.ArrayToMultiValueStringFunction, Function.ArrayToStringFunction, Function.Asin, Function.Atan, Function.Atan2, Function.BitwiseAnd, Function.BitwiseComplement, Function.BitwiseConvertDoubleToLongBits, Function.BitwiseConvertLongBitsToDouble, Function.BitwiseOr, Function.BitwiseShiftLeft, Function.BitwiseShiftRight, Function.BitwiseXor, Function.BivariateBitwiseMathFunction, Function.BivariateFunction, Function.BivariateMathFunction, Function.CaseSearchedFunc, Function.CaseSimpleFunc, Function.CastFunc, Function.Cbrt, Function.Ceil, Function.CoalesceFunc, Function.ConcatFunc, Function.ConditionFunc, Function.CopySign, Function.Cos, Function.Cosh, Function.Cot, Function.Div, Function.DoubleBivariateMathFunction, Function.DoubleUnivariateMathFunction, Function.Exp, Function.Expm1, Function.Floor, Function.GetExponent, Function.GreatestFunc, Function.HumanReadableBinaryByteFormatFunc, Function.HumanReadableDecimalByteFormatFunc, Function.HumanReadableDecimalFormatFunc, Function.Hypot, Function.IsDistinctFromFunc, Function.IsFalseFunc, Function.IsNotDistinctFromFunc, Function.IsNotFalseFunc, Function.IsNotNullFunc, Function.IsNotTrueFunc, Function.IsNullFunc, Function.IsTrueFunc, Function.LeastFunc, Function.LeftFunc, Function.Log, Function.Log10, Function.Log1p, Function.LowerFunc, Function.LpadFunc, Function.Max, Function.Min, Function.MultiValueStringHarmonizeNullsFunction, Function.MultiValueStringToArrayFunction, Function.MvContainsFunction, Function.MvOverlapFunction, Function.NextAfter, Function.NextUp, Function.NvlFunc, Function.ParseLong, Function.Pi, Function.Pow, Function.ReduceFunction, Function.Remainder, Function.RepeatFunc, Function.ReplaceFunc, Function.ReverseFunc, Function.RightFunc, Function.Rint, Function.Round, Function.RpadFunc, Function.SafeDivide, Function.ScalarInArrayFunction, Function.Scalb, Function.Signum, Function.Sin, Function.Sinh, Function.SizeFormatFunc, Function.Sqrt, Function.StringFormatFunc, Function.StringLongFunction, Function.StringToArrayFunction, Function.StrlenFunc, Function.StrposFunc, Function.SubMonthFunc, Function.SubstringFunc, Function.Tan, Function.Tanh, Function.TimestampFromEpochFunc, Function.ToDegrees, Function.ToRadians, Function.Ulp, Function.UnivariateFunction, Function.UnivariateMathFunction, Function.UnixTimestampFunc, Function.UpperFunc, HyperUniqueExpressions.HllAddExprMacro, HyperUniqueExpressions.HllCreateExprMacro, HyperUniqueExpressions.HllEstimateExprMacro, HyperUniqueExpressions.HllRoundEstimateExprMacro, IPv4AddressMatchExprMacro, IPv4AddressParseExprMacro, IPv4AddressStringifyExprMacro, IPv6AddressMatchExprMacro, LikeExprMacro, LookupExprMacro, NestedDataExpressions.JsonKeysExprMacro, NestedDataExpressions.JsonMergeExprMacro, NestedDataExpressions.JsonObjectExprMacro, NestedDataExpressions.JsonPathsExprMacro, NestedDataExpressions.JsonQueryArrayExprMacro, NestedDataExpressions.JsonQueryExprMacro, NestedDataExpressions.JsonValueExprMacro, NestedDataExpressions.ParseJsonExprMacro, NestedDataExpressions.ToJsonStringExprMacro, NestedDataExpressions.TryParseJsonExprMacro, RegexpExtractExprMacro, RegexpLikeExprMacro, RegexpReplaceExprMacro, TimestampCeilExprMacro, TimestampExtractExprMacro, TimestampFloorExprMacro, TimestampFormatExprMacro, TimestampParseExprMacro, TimestampShiftExprMacro, TrimExprMacro, TrimExprMacro.BothTrimExprMacro, TrimExprMacro.LeftTrimExprMacro, TrimExprMacro.RightTrimExprMacro

public interface NamedFunction
Common stuff for "named" functions of "functional" expressions, such as FunctionExpr, ApplyFunctionExpr, and ExprMacroTable.ExprMacroFunctionExpr. Provides helper methods for performing common validation operations to help reduce boilerplate for implementors and make it easier to provide consistent error messaging.
  • Method Details

    • name

      String name()
      Name of the function
    • validationFailed

      default ExpressionValidationException validationFailed(String reasonFormat, Object... args)
      Helper method for creating a ExpressionValidationException with the specified reason
    • validationFailed

      default ExpressionValidationException validationFailed(Throwable e, String reasonFormat, Object... args)
    • processingFailed

      default ExpressionProcessingException processingFailed(String reasonFormat, Object... args)
    • processingFailed

      default ExpressionProcessingException processingFailed(Throwable e, String reasonFormat, Object... args)
    • 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(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(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(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