Class AggregateFcts
java.lang.Object
org.apache.cassandra.cql3.functions.AggregateFcts
Factory methods for aggregate functions.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NativeAggregateFunctionAVG function for byte values (tinyint).static final NativeAggregateFunctionAVG function for counter column values.static final NativeAggregateFunctionThe AVG function for decimal values.static final NativeAggregateFunctionAVG function for double values.static final NativeAggregateFunctionAVG function for float values.static final NativeAggregateFunctionAVG function for int32 values.static final NativeAggregateFunctionAVG function for long values.static final NativeAggregateFunctionAVG function for for short values (smallint).static final NativeAggregateFunctionThe AVG function for varint values.static final AggregateFcts.CountRowsFunctionThe function used to count the number of rows of a result set.static final NativeAggregateFunctionMAX function for counter column values.static final NativeAggregateFunctionThe MIN function for counter column values.static final NativeAggregateFunctionThe SUM function for byte values (tinyint).static final NativeAggregateFunctionThe SUM function for counter column values.static final NativeAggregateFunctionThe SUM function for decimal values.static final NativeAggregateFunctionThe SUM function for double values.static final NativeAggregateFunctionThe SUM function for float values.static final NativeAggregateFunctionThe SUM function for int32 values.static final NativeAggregateFunctionThe SUM function for long values.static final NativeAggregateFunctionThe SUM function for short values (smallint).static final NativeAggregateFunctionThe SUM function for varint values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddFunctionsTo(NativeFunctions functions) static NativeAggregateFunctionmakeCountFunction(AbstractType<?> inputType) Creates a COUNT function for the specified type.static NativeAggregateFunctionmakeMaxFunction(AbstractType<?> inputType) Creates a MAX function for the specified type.static NativeAggregateFunctionmakeMinFunction(AbstractType<?> inputType) Creates a MIN function for the specified type.
-
Field Details
-
countRowsFunction
The function used to count the number of rows of a result set. This function is called when COUNT(*) or COUNT(1) is specified. -
sumFunctionForDecimal
The SUM function for decimal values. -
avgFunctionForDecimal
The AVG function for decimal values. The average of an empty value set returns zero. -
sumFunctionForVarint
The SUM function for varint values. -
avgFunctionForVarint
The AVG function for varint values. The average of an empty value set returns zero. The returned value is of the same type as the input values, so the returned average won't have a decimal part. -
sumFunctionForByte
The SUM function for byte values (tinyint). The returned value is of the same type as the input values, so there is a risk of overflow if the sum of the values exceeds the maximum value that the type can represent. -
avgFunctionForByte
AVG function for byte values (tinyint). The average of an empty value set returns zero. The returned value is of the same type as the input values, so the returned average won't have a decimal part. -
sumFunctionForShort
The SUM function for short values (smallint). The returned value is of the same type as the input values, so there is a risk of overflow if the sum of the values exceeds the maximum value that the type can represent. -
avgFunctionForShort
AVG function for for short values (smallint). The average of an empty value set returns zero. The returned value is of the same type as the input values, so the returned average won't have a decimal part. -
sumFunctionForInt32
The SUM function for int32 values. The returned value is of the same type as the input values, so there is a risk of overflow if the sum of the values exceeds the maximum value that the type can represent. -
avgFunctionForInt32
AVG function for int32 values. The average of an empty value set returns zero. The returned value is of the same type as the input values, so the returned average won't have a decimal part. -
sumFunctionForLong
The SUM function for long values. The returned value is of the same type as the input values, so there is a risk of overflow if the sum of the values exceeds the maximum value that the type can represent. -
avgFunctionForLong
AVG function for long values. The average of an empty value set returns zero. The returned value is of the same type as the input values, so the returned average won't have a decimal part. -
sumFunctionForFloat
The SUM function for float values. The returned value is of the same type as the input values, so there is a risk of overflow if the sum of the values exceeds the maximum value that the type can represent. -
avgFunctionForFloat
AVG function for float values. The average of an empty value set returns zero. -
sumFunctionForDouble
The SUM function for double values. The returned value is of the same type as the input values, so there is a risk of overflow if the sum of the values exceeds the maximum value that the type can represent. -
avgFunctionForDouble
AVG function for double values. The average of an empty value set returns zero. -
sumFunctionForCounter
The SUM function for counter column values. -
avgFunctionForCounter
AVG function for counter column values. -
minFunctionForCounter
The MIN function for counter column values. -
maxFunctionForCounter
MAX function for counter column values.
-
-
Constructor Details
-
AggregateFcts
public AggregateFcts()
-
-
Method Details
-
addFunctionsTo
-
makeMaxFunction
Creates a MAX function for the specified type.- Parameters:
inputType- the function input and output type- Returns:
- a MAX function for the specified type.
-
makeMinFunction
Creates a MIN function for the specified type.- Parameters:
inputType- the function input and output type- Returns:
- a MIN function for the specified type.
-
makeCountFunction
Creates a COUNT function for the specified type.- Parameters:
inputType- the function input type- Returns:
- a COUNT function for the specified type.
-