Class HivePartitionDescriptor

All Implemented Interfaces:
Iterable<List<PartitionLocation>>, PartitionDescriptor

public class HivePartitionDescriptor extends AbstractPartitionDescriptor
  • Constructor Details

  • Method Details

    • getPartitionHierarchyIndex

      public int getPartitionHierarchyIndex(String partitionName)
      Description copied from interface: PartitionDescriptor
      Get the hierarchy index of the given partition For eg: if we have the partition laid out as follows 1997/q1/jan then getPartitionHierarchyIndex("jan") => 2
      partitionName - Partition name
      the index of specified partition name in the hierarchy
    • isPartitionName

      public boolean isPartitionName(String name)
      Description copied from interface: PartitionDescriptor
      Given a column name return boolean to indicate if its a partition column or not
      name - of Partition
      true, if this is the partition name and vise versa.
    • getMaxHierarchyLevel

      public int getMaxHierarchyLevel()
      Description copied from interface: PartitionDescriptor
      Maximum level of partition nesting/ hierarchy supported
      maximum supported level number of partition hierarchy
    • getBaseTableLocation

      public org.apache.hadoop.fs.Path getBaseTableLocation()
    • populatePartitionVectors

      public void populatePartitionVectors(ValueVector[] vectors, List<PartitionLocation> partitions, BitSet partitionColumnBitSet, Map<Integer,String> fieldNameMap)
      Description copied from interface: PartitionDescriptor
      Creates an in memory representation of all the partitions. For each level of partitioning we will create a value vector which this method will populate for all the partitions with the values of the partitioning key
      vectors - - Array of vectors in the container that need to be populated
      partitions - - List of all the partitions that exist in the table
      partitionColumnBitSet - - Partition columns selected in the query
      fieldNameMap - - Maps field ordinal to the field name
    • getVectorType

      public TypeProtos.MajorType getVectorType(SchemaPath column, PlannerSettings plannerSettings)
      Description copied from interface: PartitionDescriptor
      Method returns the Major type associated with the given column
      column - - column whose type should be determined
    • getIdIfValid

      public Integer getIdIfValid(String name)
      Description copied from interface: PartitionDescriptor
      Check to see if the name is a partition name.
      name - The field name you want to compare to partition names.
      Return index if valid, otherwise return null;
    • createPartitionSublists

      protected void createPartitionSublists()
      Description copied from class: AbstractPartitionDescriptor
      Create sublists of the partition locations, each sublist of size at most PartitionDescriptor.PARTITION_BATCH_SIZE
      Specified by:
      createPartitionSublists in class AbstractPartitionDescriptor
    • createTableScan

      public org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitions, boolean wasAllPartitionsPruned) throws Exception
      Description copied from interface: PartitionDescriptor
      Create a new TableScan rel node, given the lists of new partitions or new files to SCAN.