Interface PartitionDescriptor

All Superinterfaces:
Iterable<List<PartitionLocation>>
All Known Implementing Classes:
AbstractPartitionDescriptor, FileSystemPartitionDescriptor, HivePartitionDescriptor, ParquetPartitionDescriptor

public interface PartitionDescriptor extends Iterable<List<PartitionLocation>>
Interface used to describe partitions. Currently used by file system based partitions and hive partitions
  • Field Details

  • Method Details

    • getPartitionHierarchyIndex

      int getPartitionHierarchyIndex(String partitionName)
      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
      Parameters:
      partitionName - Partition name
      Returns:
      the index of specified partition name in the hierarchy
    • isPartitionName

      boolean isPartitionName(String name)
      Given a column name return boolean to indicate if its a partition column or not
      Parameters:
      name - of Partition
      Returns:
      true, if this is the partition name and vise versa.
    • getIdIfValid

      Integer getIdIfValid(String name)
      Check to see if the name is a partition name.
      Parameters:
      name - The field name you want to compare to partition names.
      Returns:
      Return index if valid, otherwise return null;
    • getMaxHierarchyLevel

      int getMaxHierarchyLevel()
      Maximum level of partition nesting/ hierarchy supported
      Returns:
      maximum supported level number of partition hierarchy
    • populatePartitionVectors

      void populatePartitionVectors(ValueVector[] vectors, List<PartitionLocation> partitions, BitSet partitionColumnBitSet, Map<Integer,String> fieldNameMap)
      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
      Parameters:
      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

      TypeProtos.MajorType getVectorType(SchemaPath column, PlannerSettings plannerSettings)
      Method returns the Major type associated with the given column
      Parameters:
      column - - column whose type should be determined
      plannerSettings -
    • createTableScan

      org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitions, boolean wasAllPartitionsPruned) throws Exception
      Create a new TableScan rel node, given the lists of new partitions or new files to SCAN.
      Parameters:
      newPartitions -
      wasAllPartitionsPruned -
      Throws:
      Exception
    • createTableScan

      org.apache.calcite.rel.core.TableScan createTableScan(List<PartitionLocation> newPartitions, org.apache.hadoop.fs.Path cacheFileRoot, boolean wasAllPartitionsPruned, MetadataContext metaContext) throws Exception
      Create a new TableScan rel node, given the lists of new partitions or new files to scan and a path to a metadata cache file
      Parameters:
      newPartitions -
      cacheFileRoot -
      wasAllPartitionsPruned -
      metaContext -
      Throws:
      Exception
    • supportsMetadataCachePruning

      boolean supportsMetadataCachePruning()
    • getBaseTableLocation

      org.apache.hadoop.fs.Path getBaseTableLocation()