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
agg
(String aggregationFunctionKey, List<com.activeviam.database.api.schema.FieldPath> originFields, List<String> targetColumnNames) static MeasureMapping
avg
(com.activeviam.database.api.schema.FieldPath originField, String targetSumField, String targetColumnName) Creates a mapping for a pre-aggregated average.static MeasureMapping
Creates a mapping for a pre-aggregated count.boolean
List
<com.activeviam.database.api.schema.FieldPath> 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<com.activeviam.database.api.schema.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
public static MeasureMapping sum(com.activeviam.database.api.schema.FieldPath originField, String targetColumnName) 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
public static MeasureMapping min(com.activeviam.database.api.schema.FieldPath originField, String targetColumnName) 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
public static MeasureMapping max(com.activeviam.database.api.schema.FieldPath originField, String targetColumnName) 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(com.activeviam.database.api.schema.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
public static MeasureMapping sumProduct(List<com.activeviam.database.api.schema.FieldPath> originFields, String targetColumnName) 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
public static MeasureMapping agg(String aggregationFunctionKey, List<com.activeviam.database.api.schema.FieldPath> originFields, List<String> targetColumnNames) -
getAggregationFunctionKey
-
getOriginFields
-
getTargetColumnNames
-
equals
-
hashCode
public int hashCode() -
toString
-