Class HiveMetadataProvider.HiveStats

java.lang.Object
org.apache.drill.exec.store.hive.HiveMetadataProvider.HiveStats
Enclosing class:
HiveMetadataProvider

public static class HiveMetadataProvider.HiveStats extends Object
Contains stats. Currently only numRows and totalSizeInBytes are used.
  • Constructor Details

    • HiveStats

      public HiveStats(long numRows, long sizeInBytes)
  • Method Details

    • getStatsFromProps

      public static HiveMetadataProvider.HiveStats getStatsFromProps(Properties properties)
      Get the stats from table properties. If not found -1 is returned for each stats field. CAUTION: stats may not be up-to-date with the underlying data. It is always good to run the ANALYZE command on Hive table to have up-to-date stats.
      Parameters:
      properties - the source of table stats
      Returns:
      HiveMetadataProvider.HiveStats instance with rows number and size in bytes from specified properties
    • getNumRows

      public long getNumRows()
    • getSizeInBytes

      public long getSizeInBytes()
    • valid

      public boolean valid()
      Both numRows and sizeInBytes are expected to be greater than 0 for stats to be valid
    • add

      public void add(HiveMetadataProvider.HiveStats s)
    • toString

      public String toString()
      Overrides:
      toString in class Object