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 Link icon

    • count Link icon

      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 Link icon

      public static MeasureMapping sum(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 Link icon

      public static MeasureMapping min(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 Link icon

      public static MeasureMapping max(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 Link icon

      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 Link icon

      public static MeasureMapping sumProduct(List<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 Link icon

      public static MeasureMapping agg(String aggregationFunctionKey, List<FieldPath> originFields, List<String> targetColumnNames)
    • getAggregationFunctionKey Link icon

      public String getAggregationFunctionKey()
    • getOriginFields Link icon

      public List<FieldPath> getOriginFields()
    • getTargetColumnNames Link icon

      public List<String> getTargetColumnNames()
    • equals Link icon

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

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

      public String toString()
      Overrides:
      toString in class Object