Class ScalarFunctionInfo
java.lang.Object
se.kuseman.payloadbuilder.api.catalog.FunctionInfo
se.kuseman.payloadbuilder.api.catalog.ScalarFunctionInfo
Definition of a scalar function
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumMode of aggregationNested classes/interfaces inherited from class se.kuseman.payloadbuilder.api.catalog.FunctionInfo
FunctionInfo.Arity, FunctionInfo.FunctionType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAggregator(ScalarFunctionInfo.AggregateMode mode, String catalogAlias, List<IExpression> arguments) Create an aggregator for this functionevalScalar(IExecutionContext context, ScalarFunctionInfo.AggregateMode mode, TupleVector input, String catalogAlias, List<IExpression> arguments) Evaluate this function in scalar mode with an aggregation mode.evalScalar(IExecutionContext context, ScalarFunctionInfo.AggregateMode mode, TupleVector input, ValueVector selection, String catalogAlias, List<IExpression> arguments) Evaluate this function in scalar mode with an aggregation mode with a row selection.evalScalar(IExecutionContext context, TupleVector input, String catalogAlias, List<IExpression> arguments) Evaluate this function in scalar mode.evalScalar(IExecutionContext context, TupleVector input, ValueVector selection, String catalogAlias, List<IExpression> arguments) Evaluate this expression against input with a row selection.fold(IExecutionContext context, List<IExpression> arguments) Folds this function and returns a new expression.getAggregateType(List<IExpression> arguments) Data type of this function in aggregate mode.getType(List<IExpression> arguments) Data type of this functionbooleanisConstant(List<? extends IExpression> arguments) Returns true if this function is contantMethods inherited from class se.kuseman.payloadbuilder.api.catalog.FunctionInfo
arity, equals, getDescription, getFunctionType, getName, hashCode, requiresNamedArguments, toString
-
Constructor Details
-
ScalarFunctionInfo
-
-
Method Details
-
fold
Folds this function and returns a new expression. This can be used to return a literal expression if all arguments are constant etc.- Returns:
- New expression if one could be created otherwise null
-
getType
Data type of this function- Parameters:
arguments- Supplier for arguments data types
-
getAggregateType
Data type of this function in aggregate mode. NOTE! Only applicable ifFunctionInfo.FunctionTypeisFunctionInfo.FunctionType.AGGREGATEorFunctionInfo.FunctionType.SCALAR_AGGREGATE- Parameters:
arguments- Supplier for arguments data types
-
evalScalar
public ValueVector evalScalar(IExecutionContext context, TupleVector input, String catalogAlias, List<IExpression> arguments) Evaluate this function in scalar mode. -
evalScalar
public ValueVector evalScalar(IExecutionContext context, TupleVector input, ValueVector selection, String catalogAlias, List<IExpression> arguments) Evaluate this expression against input with a row selection. -
evalScalar
public ValueVector evalScalar(IExecutionContext context, ScalarFunctionInfo.AggregateMode mode, TupleVector input, String catalogAlias, List<IExpression> arguments) Evaluate this function in scalar mode with an aggregation mode. This is typically an aggregate function that can also act as a scalar function. Example function sum select sum(DISTINCT col1) <--- aggregate function with aggregate mode from table group by col2 select collection.map(x -> x.col > 10).sum(DISTINCT) <--- scalar function with aggregate mode from .....
-
evalScalar
public ValueVector evalScalar(IExecutionContext context, ScalarFunctionInfo.AggregateMode mode, TupleVector input, ValueVector selection, String catalogAlias, List<IExpression> arguments) Evaluate this function in scalar mode with an aggregation mode with a row selection. This is typically an aggregate function that can also act as a scalar function. Example function sum select sum(DISTINCT col1) <--- aggregate function with aggregate mode from table group by col2 select collection.map(x -> x.col > 10).sum(DISTINCT) <--- scalar function with aggregate mode from .....
-
createAggregator
public IAggregator createAggregator(ScalarFunctionInfo.AggregateMode mode, String catalogAlias, List<IExpression> arguments) Create an aggregator for this function -
isConstant
Returns true if this function is contant
-