Class HivePartitionHolder

java.lang.Object
org.apache.drill.exec.store.hive.HivePartitionHolder

public class HivePartitionHolder extends Object
Helper class that stores partition values per key. Key to index mapper contains key and index corresponding to partition values position in partition values list. Since several keys may have that same partition values, such structure is optimized to save memory usage. Partition values are stored in list of consecutive values.
  • Constructor Details

    • HivePartitionHolder

      public HivePartitionHolder(Map<org.apache.hadoop.fs.Path,Integer> keyToIndexMapper, List<List<String>> partitionValues)
    • HivePartitionHolder

      public HivePartitionHolder()
  • Method Details

    • getKeyToIndexMapper

      public Map<org.apache.hadoop.fs.Path,Integer> getKeyToIndexMapper()
    • getPartitionValues

      public List<List<String>> getPartitionValues()
    • add

      public void add(org.apache.hadoop.fs.Path key, List<String> values)
      Checks if partition values already exist in holder. If not, adds them to holder and adds key and index corresponding to partition values to mapper. If partition values exist, adds key and existing partition values index to mapper.
      Parameters:
      key - mapper key
      values - partition values
    • get

      public List<String> get(org.apache.hadoop.fs.Path key)
      Returns list of partition values stored in holder for the given key. If there are no corresponding partition values, return empty list.
      Parameters:
      key - mapper key
      Returns:
      list of partition values