Class UDAggregate
java.lang.Object
org.apache.cassandra.cql3.functions.AbstractFunction
org.apache.cassandra.cql3.functions.UserFunction
org.apache.cassandra.cql3.functions.UDAggregate
- All Implemented Interfaces:
AssignmentTestable,AggregateFunction,Function,SchemaElement
Base class for user-defined-aggregates.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.functions.AggregateFunction
AggregateFunction.AggregateNested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResultNested classes/interfaces inherited from interface org.apache.cassandra.cql3.SchemaElement
SchemaElement.SchemaElementType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ByteBufferprotected static final org.slf4j.LoggerFields inherited from class org.apache.cassandra.cql3.functions.AbstractFunction
argTypes, name, returnTypeFields inherited from interface org.apache.cassandra.cql3.functions.Function
UNRESOLVEDFields inherited from interface org.apache.cassandra.cql3.SchemaElement
NAME_COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionUDAggregate(FunctionName name, List<AbstractType<?>> argTypes, AbstractType<?> returnType, ScalarFunction stateFunc, ScalarFunction finalFunc, ByteBuffer initcond) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFunctionsTo(List<Function> functions) static UDAggregatecreate(Collection<UDFunction> functions, FunctionName name, List<AbstractType<?>> argTypes, AbstractType<?> returnType, FunctionName stateFunc, FunctionName finalFunc, AbstractType<?> stateType, ByteBuffer initcond) Return the schema element typebooleaninthashCode()booleanhasReferenceTo(Function function) booleanChecks whether the function is an aggregate function or not.booleanisPure()Checks whether the function is a pure function (as in doesn't depend on, nor produces side effects) or not.Creates a newAggregateinstance.newArguments(ProtocolVersion version) Creates some new input arguments for this function.booleanreferencesUserType(ByteBuffer name) AbstractType<?>toCqlString(boolean withInternals, boolean ifNotExists) Returns a CQL representation of this elementwithUpdatedUserType(Collection<UDFunction> udfs, UserType udt) Methods inherited from class org.apache.cassandra.cql3.functions.UserFunction
isNativeMethods inherited from class org.apache.cassandra.cql3.functions.AbstractFunction
argTypes, argumentsList, columnName, elementKeyspace, elementName, getCompatibleTypeIfKnown, name, returnType, testAssignment, toCqlString, toString, typesMatchMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cassandra.cql3.AssignmentTestable
getCompatibleTypeIfKnown, testAssignmentMethods inherited from interface org.apache.cassandra.cql3.functions.Function
argTypes, columnName, isNative, name, returnTypeMethods inherited from interface org.apache.cassandra.cql3.SchemaElement
elementKeyspace, elementKeyspaceQuotedIfNeeded, elementName, elementNameQuotedIfNeeded
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
initcond
-
-
Constructor Details
-
UDAggregate
public UDAggregate(FunctionName name, List<AbstractType<?>> argTypes, AbstractType<?> returnType, ScalarFunction stateFunc, ScalarFunction finalFunc, ByteBuffer initcond)
-
-
Method Details
-
create
public static UDAggregate create(Collection<UDFunction> functions, FunctionName name, List<AbstractType<?>> argTypes, AbstractType<?> returnType, FunctionName stateFunc, FunctionName finalFunc, AbstractType<?> stateType, ByteBuffer initcond) -
isPure
public boolean isPure()Description copied from interface:FunctionChecks whether the function is a pure function (as in doesn't depend on, nor produces side effects) or not. -
newArguments
Description copied from interface:FunctionCreates some new input arguments for this function.- Specified by:
newArgumentsin interfaceFunction- Parameters:
version- the protocol version- Returns:
- some new input arguments for this function
-
hasReferenceTo
-
referencesUserType
- Specified by:
referencesUserTypein interfaceFunction- Overrides:
referencesUserTypein classAbstractFunction
-
withUpdatedUserType
-
addFunctionsTo
- Specified by:
addFunctionsToin interfaceFunction- Overrides:
addFunctionsToin classAbstractFunction
-
isAggregate
public boolean isAggregate()Description copied from interface:FunctionChecks whether the function is an aggregate function or not.- Specified by:
isAggregatein interfaceFunction- Returns:
trueif the function is an aggregate function,falseotherwise.
-
stateFunction
-
finalFunction
-
initialCondition
-
stateType
-
newAggregate
Description copied from interface:AggregateFunctionCreates a newAggregateinstance.- Specified by:
newAggregatein interfaceAggregateFunction- Returns:
- a new
Aggregateinstance. - Throws:
InvalidRequestException
-
equals
- Overrides:
equalsin classAbstractFunction
-
compare
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractFunction
-
elementType
Description copied from interface:SchemaElementReturn the schema element type- Specified by:
elementTypein interfaceSchemaElement- Returns:
- the schema element type
-
toCqlString
Description copied from interface:SchemaElementReturns a CQL representation of this element- Specified by:
toCqlStringin interfaceSchemaElement- Parameters:
withInternals- if the internals part of the CQL should be exposed.ifNotExists- if "IF NOT EXISTS" should be included.- Returns:
- a CQL representation of this element
-