Package org.apache.druid.math.expr
Class ApplyFunction.FilterFunction
java.lang.Object
org.apache.druid.math.expr.ApplyFunction.FilterFunction
- All Implemented Interfaces:
ApplyFunction,NamedFunction
- Enclosing interface:
ApplyFunction
Filter an array to all elements that evaluate to a 'truthy' value for a
LambdaExpr-
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 -
Method Summary
Modifier and TypeMethodDescriptionapply(LambdaExpr lambdaExpr, List<Expr> argsExpr, Expr.ObjectBinding bindings) getArrayInputs(List<Expr> args) Get list of input arguments which must evaluate to an arrayExprTypegetOutputType(Expr.InputBindingInspector inspector, 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.booleanhasArrayOutput(LambdaExpr lambdaExpr) Returns true if apply function produces an array output.name()Name of the functionvoidvalidateArguments(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, waitMethods inherited from interface org.apache.druid.math.expr.ApplyFunction
asVectorProcessor, canVectorizeMethods inherited from interface org.apache.druid.math.expr.NamedFunction
processingFailed, processingFailed, validationFailed, validationFailed, validationHelperCheckAnyOfArgumentCount, validationHelperCheckArgIsLiteral, validationHelperCheckArgumentCount, validationHelperCheckArgumentCount, validationHelperCheckArgumentRange, validationHelperCheckLambaArgumentCount, validationHelperCheckMinArgumentCount, validationHelperCheckMinArgumentCount
-
Constructor Details
-
FilterFunction
public FilterFunction()
-
-
Method Details
-
name
Description copied from interface:NamedFunctionName of the function- Specified by:
namein interfaceNamedFunction
-
hasArrayOutput
Description copied from interface:ApplyFunctionReturns true if apply function produces an array output. AllApplyFunctionimplementations are expected to exclusively produce either scalar or array values.- Specified by:
hasArrayOutputin interfaceApplyFunction
-
apply
Description copied from interface:ApplyFunctionApplyLambdaExprto argument list ofExprgiven 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 forIdentifierExprin the lambda body.- Specified by:
applyin interfaceApplyFunction
-
getArrayInputs
Description copied from interface:ApplyFunctionGet list of input arguments which must evaluate to an arrayExprType- Specified by:
getArrayInputsin interfaceApplyFunction
-
validateArguments
Description copied from interface:ApplyFunctionValidate function arguments. This method is called whenever aApplyFunctionExpris created, and should validate everything that is feasible up front. Note that input type information is typically unavailable at the timeExprare parsed, and so this method is incapable of performing complete validation.- Specified by:
validateArgumentsin interfaceApplyFunction
-
getOutputType
@Nullable public ExpressionType getOutputType(Expr.InputBindingInspector inspector, LambdaExpr expr, List<Expr> args) Description copied from interface:ApplyFunctionCompute the output type of this function for a given lambda and the argument expressions which will be applied as its inputs.- Specified by:
getOutputTypein interfaceApplyFunction- See Also:
-