Class AnalyzeColumnUtils

java.lang.Object
org.apache.drill.exec.metastore.analyze.AnalyzeColumnUtils

public class AnalyzeColumnUtils extends Object
  • Field Details

    • COLUMN_STATISTICS_FUNCTIONS

      public static final Map<StatisticsKind<?>,org.apache.calcite.sql.SqlKind> COLUMN_STATISTICS_FUNCTIONS
    • COLUMN_STATISTICS_TYPES

      public static final Map<StatisticsKind<?>,TypeProtos.MinorType> COLUMN_STATISTICS_TYPES
    • META_STATISTICS_FUNCTIONS

      public static final Map<StatisticsKind<?>,org.apache.calcite.sql.SqlKind> META_STATISTICS_FUNCTIONS
  • Constructor Details

    • AnalyzeColumnUtils

      public AnalyzeColumnUtils()
  • Method Details

    • getColumnName

      public static String getColumnName(String fullName)
      Returns actual column name obtained form intermediate name which includes statistics kind and other analyze-specific info.

      Example: column which corresponds to max statistics value for `o_shippriority` column is column$maxValue$`o_shippriority`. This method will return escaped actual column name: `o_shippriority`.

      Parameters:
      fullName - the source of actual column name
      Returns:
      actual column name
    • getStatisticsKind

      public static StatisticsKind<?> getStatisticsKind(String fullName)
      Returns StatisticsKind instance obtained form intermediate field name.
      Parameters:
      fullName - the source of StatisticsKind to obtain
      Returns:
      StatisticsKind instance
    • getColumnStatisticsFieldName

      public static String getColumnStatisticsFieldName(String columnName, StatisticsKind<?> statisticsKind)
      Returns analyze-specific field name for column statistics which includes actual column name and statistics kind information.

      Example: analyze-specific field name for column `o_shippriority` and statistics MAX_VALUE is the following: column$maxValue$`o_shippriority`.

      Parameters:
      columnName - name of the column
      statisticsKind - statistics kind
      Returns:
      analyze-specific field name which includes actual column name and statistics kind information
    • getMetadataStatisticsFieldName

      public static String getMetadataStatisticsFieldName(StatisticsKind<?> statisticsKind)
      Returns analyze-specific field name for metadata statistics which includes statistics kind information.

      Example: analyze-specific field name for statistics ROW_COUNT is the following: metadata$rowCount.

      Parameters:
      statisticsKind - statistics kind
      Returns:
      analyze-specific field name for metadata statistics
    • isColumnStatisticsField

      public static boolean isColumnStatisticsField(String fieldName)
      Checks whether specified field name is analyze-specific field for column statistics.
      Parameters:
      fieldName - name of the field to check
      Returns:
      true if specified field name is analyze-specific field for column statistics
    • isMetadataStatisticsField

      public static boolean isMetadataStatisticsField(String fieldName)
      Checks whether specified field name is analyze-specific field for metadata statistics.
      Parameters:
      fieldName - name of the field to check
      Returns:
      true if specified field name is analyze-specific field for metadata statistics