Package org.apache.druid.math.expr
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.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.MultiValueStringToArrayFunction
,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.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
,LikeExprMacro
,LookupExprMacro
,NestedDataExpressions.JsonKeysExprMacro
,NestedDataExpressions.JsonObjectExprMacro
,NestedDataExpressions.JsonPathsExprMacro
,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 asFunctionExpr
,ApplyFunctionExpr
, andExprMacroTable.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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
name()
Name of the functiondefault ExpressionProcessingException
processingFailed(Throwable e, String reasonFormat, Object... args)
default ExpressionValidationException
validationFailed(String reasonFormat, Object... args)
Helper method for creating aExpressionValidationException
with the specified reasondefault ExpressionValidationException
validationFailed(Throwable e, String reasonFormat, Object... args)
default void
validationHelperCheckAnyOfArgumentCount(List<Expr> args, int... counts)
Helper method for implementors performing validation to check if argument count is any of specified countsdefault void
validationHelperCheckArgIsLiteral(Expr arg, String argName)
Helper method for implementors performing validation to check that an argument is a literaldefault void
validationHelperCheckArgumentCount(List<Expr> args, int count)
Helper method for implementors performing validation to check if the argument count is expecteddefault 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.default void
validationHelperCheckArgumentRange(List<Expr> args, int start, int end)
default void
validationHelperCheckLambaArgumentCount(org.apache.druid.math.expr.LambdaExpr lambdaExpr, List<Expr> args)
Helper method for implementors performing validation to check that theLambdaExpr.identifierCount()
matches the number of arguments being passed to itdefault void
validationHelperCheckMinArgumentCount(List<Expr> args, int count)
Helper method for implementors performing validation to check if there are at least as many arguments as specifieddefault 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.
-
-
-
Method Detail
-
name
String name()
Name of the function
-
validationFailed
default ExpressionValidationException validationFailed(String reasonFormat, Object... args)
Helper method for creating aExpressionValidationException
with the specified reason
-
validationFailed
default ExpressionValidationException validationFailed(Throwable e, 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(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 theLambdaExpr
'(x, acc) -> x + acc' and the list of arguments, ['col', 0], and so does not include theLambdaExpr
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 theLambdaExpr
'(x, acc) -> x + acc' and the list of arguments, ['col', 0], and so does not include theLambdaExpr
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 theLambdaExpr.identifierCount()
matches the number of arguments being passed to it
-
-