Class ColumnStatistics<T>

java.lang.Object
org.apache.drill.metastore.statistics.ColumnStatistics<T>
Type Parameters:
T - type of column values

public class ColumnStatistics<T> extends Object
Represents collection of statistics values for specific column. For example, text representation of ColumnStatistics for varchar column is the following:
 {
     "statistics":[
         {"statisticsValue":2.1,"statisticsKind":{"name":"approx_count_distinct"}},
         {"statisticsValue":"aaa","statisticsKind":{"exact":true,"name":"minValue"}},
         {"statisticsValue":3,"statisticsKind":{"exact":true,"name":"nullsCount"}},
         {"statisticsValue":"zzz","statisticsKind":{"exact":true,"name":"maxValue"}}],
     "type":"VARCHAR"
 }
 
  • Constructor Details

  • Method Details

    • get

      public <V> V get(StatisticsKind<V> statisticsKind)
      Returns statistics value which corresponds to specified StatisticsKind.
      Parameters:
      statisticsKind - kind of statistics which value should be returned
      Returns:
      statistics value
    • contains

      public boolean contains(StatisticsKind<?> statisticsKind)
      Checks whether specified statistics kind is set in this column statistics.
      Parameters:
      statisticsKind - statistics kind to check
      Returns:
      true if specified statistics kind is set
    • containsExact

      public boolean containsExact(StatisticsKind<?> statisticsKind)
      Checks whether specified statistics kind is set in this column statistics and it corresponds to the exact statistics value.
      Parameters:
      statisticsKind - statistics kind to check
      Returns:
      true if value which corresponds to the specified statistics kind is exact
    • getValueComparator

      public Comparator<T> getValueComparator()
      Returns Comparator for comparing values with the same type as column values.
      Returns:
      Comparator
    • cloneWith

      public ColumnStatistics<T> cloneWith(ColumnStatistics<T> sourceStatistics)
      Returns new ColumnStatistics instance with overridden statistics taken from specified ColumnStatistics.
      Parameters:
      sourceStatistics - source of statistics to override
      Returns:
      new ColumnStatistics instance with overridden statistics
    • genericClone

      public ColumnStatistics<T> genericClone(ColumnStatistics<?> sourceStatistics)
    • getComparatorType

      public TypeProtos.MinorType getComparatorType()
    • jsonString

      public String jsonString()
    • 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
    • of

      public static ColumnStatistics<?> of(String columnStatistics)