Package org.apache.iceberg.util
Class SortOrderUtil
java.lang.Object
org.apache.iceberg.util.SortOrderUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic SortOrderbuildSortOrder(Schema schema, PartitionSpec spec, SortOrder sortOrder) Build a final sort order that satisfies the clustering required by the partition spec.static SortOrderbuildSortOrder(Table table) static SortOrderbuildSortOrder(Table table, SortOrder sortOrder) static SortOrderfindTableSortOrder(Table table, SortOrder userSuppliedSortOrder) orderPreservingSortedColumns(SortOrder sortOrder)
-
Method Details
-
buildSortOrder
-
buildSortOrder
-
findTableSortOrder
- Parameters:
table- the table to try and match the sort order againstuserSuppliedSortOrder- the user supplied sort order to try and match with a table sort order- Returns:
- the matching
SortOrderfrom the table (with the orderId set) orSortOrder.unsorted()if no match is found.
-
buildSortOrder
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 schemaspec- a partition specsortOrder- a sort order- Returns:
- the sort order with additional sort fields to satisfy the clustering required by the spec
-
orderPreservingSortedColumns
-