Package org.apache.druid.math.expr
Class ApplyFunction.MatchFunction
- java.lang.Object
-
- org.apache.druid.math.expr.ApplyFunction.MatchFunction
-
- All Implemented Interfaces:
ApplyFunction
,NamedFunction
- Direct Known Subclasses:
ApplyFunction.AllMatchFunction
,ApplyFunction.AnyMatchFunction
- Enclosing interface:
- ApplyFunction
public abstract static class ApplyFunction.MatchFunction extends Object implements ApplyFunction
Base class for family ofApplyFunction
which evaluate elements elements of a single array input against aLambdaExpr
to evaluate to a final 'truthy' value
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.druid.math.expr.ApplyFunction
ApplyFunction.AllMatchFunction, ApplyFunction.AnyMatchFunction, ApplyFunction.BaseFoldFunction, ApplyFunction.BaseMapFunction, ApplyFunction.CartesianFoldFunction, ApplyFunction.CartesianFoldLambdaBinding, ApplyFunction.CartesianMapFunction, ApplyFunction.CartesianMapLambdaBinding, ApplyFunction.FilterFunction, ApplyFunction.FoldFunction, ApplyFunction.FoldLambdaBinding, ApplyFunction.IndexableFoldLambdaBinding, ApplyFunction.IndexableMapLambdaObjectBinding, ApplyFunction.LambdaInputBindingInspector, ApplyFunction.MapFunction, ApplyFunction.MapLambdaBinding, ApplyFunction.MatchFunction, ApplyFunction.SettableLambdaBinding
-
-
Constructor Summary
Constructors Constructor Description MatchFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ExprEval
apply(org.apache.druid.math.expr.LambdaExpr lambdaExpr, List<Expr> argsExpr, Expr.ObjectBinding bindings)
Set<Expr>
getArrayInputs(List<Expr> args)
Get list of input arguments which must evaluate to an arrayExprType
ExpressionType
getOutputType(Expr.InputBindingInspector inspector, org.apache.druid.math.expr.LambdaExpr expr, List<Expr> args)
Compute the output type of this function for a given lambda and the argument expressions which will be applied as its inputs.abstract ExprEval
match(Object[] values, org.apache.druid.math.expr.LambdaExpr expr, ApplyFunction.SettableLambdaBinding bindings)
void
validateArguments(org.apache.druid.math.expr.LambdaExpr lambdaExpr, List<Expr> args)
Validate function arguments.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.math.expr.ApplyFunction
asVectorProcessor, canVectorize, hasArrayOutput
-
Methods inherited from interface org.apache.druid.math.expr.NamedFunction
name, processingFailed, validationFailed, validationFailed, validationHelperCheckAnyOfArgumentCount, validationHelperCheckArgIsLiteral, validationHelperCheckArgumentCount, validationHelperCheckArgumentCount, validationHelperCheckArgumentRange, validationHelperCheckLambaArgumentCount, validationHelperCheckMinArgumentCount, validationHelperCheckMinArgumentCount
-
-
-
-
Method Detail
-
apply
public ExprEval apply(org.apache.druid.math.expr.LambdaExpr lambdaExpr, List<Expr> argsExpr, Expr.ObjectBinding bindings)
Description copied from interface:ApplyFunction
ApplyLambdaExpr
to argument list ofExpr
given a set of outerExpr.ObjectBinding
. These outer bindings will be used to form the scope for the bindings used to evaluate theLambdaExpr
, which use the array inputs to supply scalar values to use as bindings forIdentifierExpr
in the lambda body.- Specified by:
apply
in interfaceApplyFunction
-
getArrayInputs
public Set<Expr> getArrayInputs(List<Expr> args)
Description copied from interface:ApplyFunction
Get list of input arguments which must evaluate to an arrayExprType
- Specified by:
getArrayInputs
in interfaceApplyFunction
-
validateArguments
public void validateArguments(org.apache.druid.math.expr.LambdaExpr lambdaExpr, List<Expr> args)
Description copied from interface:ApplyFunction
Validate function arguments. This method is called whenever aApplyFunctionExpr
is created, and should validate everything that is feasible up front. Note that input type information is typically unavailable at the timeExpr
are parsed, and so this method is incapable of performing complete validation.- Specified by:
validateArguments
in interfaceApplyFunction
-
getOutputType
@Nullable public ExpressionType getOutputType(Expr.InputBindingInspector inspector, org.apache.druid.math.expr.LambdaExpr expr, List<Expr> args)
Description copied from interface:ApplyFunction
Compute the output type of this function for a given lambda and the argument expressions which will be applied as its inputs.- Specified by:
getOutputType
in interfaceApplyFunction
- See Also:
Expr.getOutputType(org.apache.druid.math.expr.Expr.InputBindingInspector)
-
match
public abstract ExprEval match(Object[] values, org.apache.druid.math.expr.LambdaExpr expr, ApplyFunction.SettableLambdaBinding bindings)
-
-