org.apache.sysds.runtime.compress.estim

## Class CompressedSizeInfoColGroup

- java.lang.Object
- - org.apache.sysds.runtime.compress.estim.CompressedSizeInfoColGroup

-     public class CompressedSizeInfoColGroup
      extends Object

  Information collected about a specific ColGroup's compression size.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompressedSizeInfoColGroup(EstimationFactors facts, Set<AColGroup.CompressionType> validCompressionTypes, ABitmap map)` Main Constructor for accurate estimates.
    `CompressedSizeInfoColGroup(int[] columns, int numVals, int numRows)` Join columns without analyzing the content.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CompressedSizeInfoColGroup` | `addConstGroup(int[] columns, CompressedSizeInfoColGroup oneSide, Set<AColGroup.CompressionType> validCompressionTypes)` This method adds a column group without having to analyze.
    `boolean` | `containsZeros()`
    `boolean` | `equals(Object that)`
    `Map<AColGroup.CompressionType,Long>` | `getAllCompressionSizes()`
    `AColGroup.CompressionType` | `getBestCompressionType()`
    `AColGroup.CompressionType` | `getBestCompressionType(CompressionSettings cs)`
    `double` | `getCardinalityRatio()`
    `int[]` | `getColumns()`
    `long` | `getCompressionSize(AColGroup.CompressionType ct)`
    `AMapToData` | `getMap()`
    `long` | `getMinSize()`
    `double` | `getMostCommonFraction()`
    `int` | `getNumOffs()` Number of offsets, or number of non zero values.
    `int` | `getNumVals()` Note cardinality is the same as number of distinct values.
    `double` | `getTupleSparsity()`
    `int` | `hashCode()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CompressedSizeInfoColGroup

          public CompressedSizeInfoColGroup(int[] columns,
                                            int numVals,
                                            int numRows)

      Join columns without analyzing the content. This only specify the compression ratio if encoded in DDC since this is trivially calculated. The number of tuples contained can be set to the upper theoretical bound of two groups by multiplying the number of distinct tuple of each colGroups with each other. SHOULD NOT BE USED FOR AN ACCURATE ESTIMATE OF SIZE
      Parameters:
        `columns` - The columns combined
        `numVals` - The number of distinct value tuples contained
        `numRows` - The number of rows.

    - #### CompressedSizeInfoColGroup

          public CompressedSizeInfoColGroup(EstimationFactors facts,
                                            Set<AColGroup.CompressionType> validCompressionTypes,
                                            ABitmap map)

      Main Constructor for accurate estimates.
      Parameters:
        `facts` - The facts extracted from a number of columns, based on the estimateFactors
        `validCompressionTypes` - The list of valid compression types, allowed to be performed.
        `map` - The map of the distinct values contained in this column group.

  - ### Method Detail

    - #### addConstGroup

          public static CompressedSizeInfoColGroup addConstGroup(int[] columns,
                                                                 CompressedSizeInfoColGroup oneSide,
                                                                 Set<AColGroup.CompressionType> validCompressionTypes)

      This method adds a column group without having to analyze. This is because the columns added are constant groups. NOTE THIS IS ONLY VALID IF THE COLUMN ADDED IS EMPTY OR CONSTANT!
      Parameters:
        `columns` - The columns of the colgroups together
        `oneSide` - One of the sides, this may contain something, but the other side (not part of the argument) should not.
        `validCompressionTypes` - The List of valid compression techniques to use
      Returns:
        A Combined estimate of the column group.

    - #### getCompressionSize

          public long getCompressionSize(AColGroup.CompressionType ct)

    - #### getBestCompressionType

          public AColGroup.CompressionType getBestCompressionType(CompressionSettings cs)

    - #### getBestCompressionType

          public AColGroup.CompressionType getBestCompressionType()

    - #### getAllCompressionSizes

          public Map<AColGroup.CompressionType,Long> getAllCompressionSizes()

    - #### getMinSize

          public long getMinSize()

    - #### getNumVals

          public int getNumVals()

      Note cardinality is the same as number of distinct values.
      Returns:
        cardinality or number of distinct values.

    - #### getNumOffs

          public int getNumOffs()

      Number of offsets, or number of non zero values.
      Returns:
        Number of non zeros or number of values.

    - #### getColumns

          public int[] getColumns()

    - #### getCardinalityRatio

          public double getCardinalityRatio()

    - #### getMostCommonFraction

          public double getMostCommonFraction()

    - #### getTupleSparsity

          public double getTupleSparsity()

    - #### getMap

          public AMapToData getMap()

    - #### containsZeros

          public boolean containsZeros()

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object that)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2021 The Apache Software Foundation. All rights reserved.