Package stream.nebula.operators
Class Aggregation
- java.lang.Object
-
- stream.nebula.operators.Aggregation
-
public class Aggregation extends java.lang.Object
Represents aggregation functions on windows and provides factory methods to create these.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Aggregation
as(java.lang.String aggregatedAttribute)
static Aggregation
average(java.lang.String fieldName)
Create aAvg
aggregation function.static Aggregation
count()
Create aCount
aggregation function.java.lang.String
getAggregationFieldName()
java.lang.String
getAggregationFunction()
java.lang.String
getNameOfAggregatedAttribute()
static Aggregation
max(java.lang.String fieldName)
Create aMax
aggregation function.static Aggregation
median(java.lang.String fieldName)
Create aMedian
aggregation function.static Aggregation
min(java.lang.String fieldName)
Create aMin
aggregation function.static Aggregation
sum(java.lang.String fieldName)
Create aSum
aggregation function.
-
-
-
Method Detail
-
sum
public static Aggregation sum(java.lang.String fieldName)
Create aSum
aggregation function.- Parameters:
fieldName
- The aggregated field.- Returns:
- A
Sum
aggregation. - Throws:
java.lang.NullPointerException
- If fieldName is null.java.lang.IllegalArgumentException
- If fieldName is empty.
-
average
public static Aggregation average(java.lang.String fieldName)
Create aAvg
aggregation function.- Parameters:
fieldName
- The aggregated field.- Returns:
- A
Avg
aggregation. - Throws:
java.lang.NullPointerException
- If fieldName is null.java.lang.IllegalArgumentException
- If fieldName is empty.
-
min
public static Aggregation min(java.lang.String fieldName)
Create aMin
aggregation function.- Parameters:
fieldName
- The aggregated field.- Returns:
- A
Min
aggregation. - Throws:
java.lang.NullPointerException
- If fieldName is null.java.lang.IllegalArgumentException
- If fieldName is empty.
-
max
public static Aggregation max(java.lang.String fieldName)
Create aMax
aggregation function.- Parameters:
fieldName
- The aggregated field.- Returns:
- A
Max
aggregation. - Throws:
java.lang.NullPointerException
- If fieldName is null.java.lang.IllegalArgumentException
- If fieldName is empty.
-
median
public static Aggregation median(java.lang.String fieldName)
Create aMedian
aggregation function.- Parameters:
fieldName
- The aggregated field.- Returns:
- A
Median
aggregation. - Throws:
java.lang.NullPointerException
- If fieldName is null.java.lang.IllegalArgumentException
- If fieldName is empty.
-
count
public static Aggregation count()
Create aCount
aggregation function. Note: Count does not aggregate over an argument.- Returns:
- A
Count
aggregation.
-
as
public Aggregation as(java.lang.String aggregatedAttribute)
-
getAggregationFieldName
public java.lang.String getAggregationFieldName()
-
getAggregationFunction
public java.lang.String getAggregationFunction()
-
getNameOfAggregatedAttribute
public java.lang.String getNameOfAggregatedAttribute()
-
-