public class AggregateMetadata extends Object
CREATE AGGREGATE...
).Constructor and Description |
---|
AggregateMetadata(KeyspaceMetadata keyspace,
String fullName,
String simpleName,
List<DataType> argumentTypes,
String finalFuncSimpleName,
String finalFuncFullName,
Object initCond,
DataType returnType,
String stateFuncSimpleName,
String stateFuncFullName,
DataType stateType,
TypeCodec<Object> stateTypeCodec) |
Modifier and Type | Method and Description |
---|---|
String |
asCQLQuery()
Returns a CQL query representing this function.
|
String |
exportAsString()
Returns a CQL query representing this function in human readable form.
|
List<DataType> |
getArgumentTypes()
Returns the types of this aggregate's arguments.
|
FunctionMetadata |
getFinalFunc()
Returns the final function of this aggregate.
|
String |
getFullName()
Returns the full name of this aggregate.
|
Object |
getInitCond()
Returns the initial state value of this aggregate.
|
KeyspaceMetadata |
getKeyspace()
Returns the keyspace this aggregate belongs to.
|
DataType |
getReturnType()
Returns the return type of this aggregate.
|
String |
getSimpleName()
Returns the simple name of this aggregate.
|
FunctionMetadata |
getStateFunc()
Returns the state function of this aggregate.
|
DataType |
getStateType()
Returns the state type of this aggregate.
|
String |
toString() |
public AggregateMetadata(KeyspaceMetadata keyspace, String fullName, String simpleName, List<DataType> argumentTypes, String finalFuncSimpleName, String finalFuncFullName, Object initCond, DataType returnType, String stateFuncSimpleName, String stateFuncFullName, DataType stateType, TypeCodec<Object> stateTypeCodec)
public String exportAsString()
This method is equivalent to asCQLQuery()
but the output is formatted.
public String asCQLQuery()
public KeyspaceMetadata getKeyspace()
public String getFullName()
This is the name of the aggregate, followed by the names of the argument types between parentheses,
like it was specified in the CREATE AGGREGATE...
statement, for example sum(int)
.
public String getSimpleName()
This is the name of the aggregate, without arguments. Note that aggregates can be overloaded with
different argument lists, therefore the simple name may not be unique. For example,
sum(int)
and sum(int,int)
both have the simple name sum
.
getFullName()
public List<DataType> getArgumentTypes()
public FunctionMetadata getFinalFunc()
This is the function specified with FINALFUNC
in the CREATE AGGREGATE...
statement. It transforms the final value after the aggregation is complete.
null
if there is none.public Object getInitCond()
This is the value specified with INITCOND
in the CREATE AGGREGATE...
statement. It's passed to the initial invocation of the state function (if that function
does not accept null arguments).
null
if there is none.public DataType getReturnType()
This is the final type of the value computed by this aggregate; in other words, the return type of the final function if it is defined, or the state type otherwise.
public FunctionMetadata getStateFunc()
This is the function specified with SFUNC
in the CREATE AGGREGATE...
statement. It aggregates the current state with each row to produce a new state.
public DataType getStateType()
This is the type specified with STYPE
in the CREATE AGGREGATE...
statement. It defines the type of the value that is accumulated as the aggregate
iterates through the rows.
Copyright © 2012–2015. All rights reserved.