Class ColumnPartitionMetadata


  • public class ColumnPartitionMetadata
    extends Object
    Class for partition related column metadata:
    • The name of the Partition function used to map the column values to their partitions
    • Total number of partitions
    • Set of partitions the column contains
    • Constructor Detail

      • ColumnPartitionMetadata

        public ColumnPartitionMetadata​(String functionName,
                                       int numPartitions,
                                       Set<Integer> partitions,
                                       @Nullable
                                       Map<String,​String> functionConfig)
        Constructor for the class.
        Parameters:
        functionName - Name of the partition function
        numPartitions - Number of total partitions for this column
        partitions - Set of partitions the column contains
        functionConfig - Configuration required by partition function.
    • Method Detail

      • getFunctionName

        public String getFunctionName()
      • getNumPartitions

        public int getNumPartitions()
      • getPartitions

        public Set<Integer> getPartitions()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • extractPartitions

        public static Set<Integer> extractPartitions​(List partitionList)
        Helper method to extract partitions from configuration.

        There are two format of partition strings:

        • Integer format: e.g. "0"
        • Range format (legacy): e.g. "[0 5]"
        • TODO: remove range format once all segments use integer format