Class Partitioning

  • public class Partitioning
    extends java.lang.Object
    • Method Detail

      • hasBucketField

        public static boolean hasBucketField​(PartitionSpec spec)
        Check whether the spec contains a bucketed partition field.
        spec - a partition spec
        true if the spec has field with a bucket transform
      • sortOrderFor

        public static SortOrder sortOrderFor​(PartitionSpec spec)
        Create a sort order that will group data for a partition spec.

        If the partition spec contains bucket columns, the sort order will also have a field to sort by a column that is bucketed in the spec. The column is selected by the highest number of buckets in the transform.

        spec - a partition spec
        a sort order that will cluster data for the spec
      • partitionType

        public static Types.StructType partitionType​(Table table)
        Builds a common partition type for all specs in a table.

        Whenever a table has multiple specs, the partition type is a struct containing all columns that have ever been a part of any spec in the table.

        table - a table with one or many specs
        the constructed common partition type