Class SortOrderUtil

java.lang.Object
org.apache.iceberg.util.SortOrderUtil

public class SortOrderUtil extends Object
  • Method Details

    • buildSortOrder

      public static SortOrder buildSortOrder(Table table)
    • buildSortOrder

      public static SortOrder buildSortOrder(Table table, SortOrder sortOrder)
    • 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 Set<String> orderPreservingSortedColumns(SortOrder sortOrder)