Package com.activeviam.directquery.api
Class MeasureMapping
java.lang.Object
com.activeviam.directquery.api.MeasureMapping
Mapping between an aggregation on the fields of a schema and the column of the aggregate table.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MeasureMapping
static MeasureMapping
Creates a mapping for a pre-aggregated average.static MeasureMapping
Creates a mapping for a pre-aggregated count.boolean
int
hashCode()
static MeasureMapping
Creates a mapping for a pre-aggregated maximum.static MeasureMapping
Creates a mapping for a pre-aggregated minimum.static MeasureMapping
Creates a mapping for a pre-aggregated Sum.static MeasureMapping
sumProduct
(List<FieldPath> originFields, String targetColumnName) Creates a mapping for a pre-aggregated sum product.toString()
-
Method Details
-
count
Creates a mapping for a pre-aggregated count.- Parameters:
targetColumnName
- the name of the column containing the pre-aggregated count.
-
sum
Creates a mapping for a pre-aggregated Sum.- Parameters:
originField
- the field of the origin schema which is aggregated.targetColumnName
- the name of the column containing the pre-aggregated sum.
-
min
Creates a mapping for a pre-aggregated minimum.- Parameters:
originField
- the field of the origin schema which is aggregated.targetColumnName
- the name of the column containing the pre-aggregated min.
-
max
Creates a mapping for a pre-aggregated maximum.- Parameters:
originField
- the field of the origin schema which is aggregated.targetColumnName
- the name of the column containing the pre-aggregated max.
-
avg
public static MeasureMapping avg(FieldPath originField, String targetSumField, String targetColumnName) Creates a mapping for a pre-aggregated average. Note that average cannot simply be pre-aggregated into a single column containing the average, in order to be able to re-aggregate the data it requires two pre-aggregated columns: one containing the pre-aggregated sum and the other containing the pre-aggregated count.- Parameters:
originField
- the field of the origin schema which is aggregated.targetSumField
- the name of the column containing the pre-aggregated sum.targetColumnName
- the name of the column containing the pre-aggregated count.
-
sumProduct
Creates a mapping for a pre-aggregated sum product.- Parameters:
originFields
- the fields of the origin schema on which the sum product is applied.targetColumnName
- the name of the column containing the pre-aggregated sum product.
-
agg
-
getAggregationFunctionKey
-
getOriginFields
-
getTargetColumnNames
-
equals
-
hashCode
public int hashCode() -
toString
-