Class MeasureMapping

java.lang.Object
com.activeviam.directquery.api.MeasureMapping

public final class MeasureMapping extends Object
Mapping between an aggregation on the fields of a schema and the column of the aggregate table.
  • Method Details

    • count

      public static MeasureMapping count(String targetColumnName)
      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

      public String getAggregationFunctionKey()
    • getOriginFields

      public List<com.activeviam.database.api.schema.FieldPath> getOriginFields()
    • getTargetColumnNames

      public List<String> getTargetColumnNames()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object