Class SortOrderUtil


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

      • buildSortOrder

        public static SortOrder buildSortOrder​(Table table)
      • buildSortOrder

        public static SortOrder buildSortOrder​(Schema schema,
                                               PartitionSpec spec,
                                               SortOrder sortOrder)
        Build a final sort order that satisfies the clustering required by the partition spec.

        The incoming sort order may or may not satisfy the clustering needed by the partition spec. This modifies the sort order so that it clusters by partition and still produces the same order within each partition.

        Parameters:
        schema - a schema
        spec - a partition spec
        sortOrder - a sort order
        Returns:
        the sort order with additional sort fields to satisfy the clustering required by the spec
      • orderPreservingSortedColumns

        public static java.util.Set<java.lang.String> orderPreservingSortedColumns​(SortOrder sortOrder)