public interface ScalarFunction extends Function
AssignmentTestable.TestResult
UNRESOLVED
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
execute(ProtocolVersion protocolVersion,
java.util.List<java.nio.ByteBuffer> parameters)
Applies this function to the specified parameter.
|
boolean |
isCalledOnNullInput() |
default boolean |
isMonotonic()
Checks if the function is monotonic.
|
default ScalarFunction |
partialApplication(ProtocolVersion protocolVersion,
java.util.List<java.nio.ByteBuffer> partialParameters)
Does a partial application of the function.
|
addFunctionsTo, argTypes, columnName, compare, isAggregate, isNative, isPure, name, referencesUserType, returnType
testAssignment
boolean isCalledOnNullInput()
default boolean isMonotonic()
A function is monotonic if it is either entirely nonincreasing or nondecreasing given an ordered set of inputs.
true
if the function is monotonic false
otherwise.java.nio.ByteBuffer execute(ProtocolVersion protocolVersion, java.util.List<java.nio.ByteBuffer> parameters) throws InvalidRequestException
protocolVersion
- protocol version used for parameters and return valueparameters
- the input parametersInvalidRequestException
- if this function cannot not be applied to the parameterdefault ScalarFunction partialApplication(ProtocolVersion protocolVersion, java.util.List<java.nio.ByteBuffer> partialParameters)
To take an example, if you consider the function
text foo(int a, text b, text c, int d)then
foo.partialApplication([3, <ommitted>, 'bar', <omitted>])
will return a function bar
of signature:
text bar(text b, int d)and such that for any value of
b
and d
, bar(b, d) == foo(3, b, 'bar', d)
.protocolVersion
- protocol version used for parameterspartialParameters
- a list of input parameters for the function where some parameters can be Function.UNRESOLVED
.
The input must be of size this.argsType().size()
. For convenience, it is
allowed both to pass a list with all parameters being Function.UNRESOLVED
(the function is
then returned directly) and with none of them unresolved (in which case, if the function is pure,
it is computed and a dummy no-arg function returning the result is returned).partialParameters
that are not Function.UNRESOLVED
.Copyright © 2009- The Apache Software Foundation