Package org.apache.iceberg
Class SortOrder
java.lang.Object
org.apache.iceberg.SortOrder
- All Implemented Interfaces:
Serializable
A sort order that defines how data and delete files should be ordered in a table.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SortOrder.Builder
builderFor
(Schema schema) Creates a newsort order builder
for the givenSchema
.static void
checkCompatibility
(SortOrder sortOrder, Schema schema) boolean
fields()
Returns the list ofsort fields
for this sort orderint
hashCode()
boolean
isSorted()
Returns true if the sort order is sortedboolean
Returns true if the sort order is unsortedint
orderId()
Returns the ID of this sort orderboolean
Checks whether this order is equivalent to another order while ignoring the order id.boolean
Checks whether this order satisfies another order.schema()
Returns theSchema
for this sort ordertoString()
static SortOrder
unsorted()
Returns a sort order for unsorted tables.
-
Method Details
-
schema
Returns theSchema
for this sort order -
orderId
public int orderId()Returns the ID of this sort order -
fields
Returns the list ofsort fields
for this sort order -
isSorted
public boolean isSorted()Returns true if the sort order is sorted -
isUnsorted
public boolean isUnsorted()Returns true if the sort order is unsorted -
satisfies
Checks whether this order satisfies another order.- Parameters:
anotherSortOrder
- a different sort order- Returns:
- true if this order satisfies the given order
-
sameOrder
Checks whether this order is equivalent to another order while ignoring the order id.- Parameters:
anotherSortOrder
- a different sort order- Returns:
- true if this order is equivalent to the given order
-
toUnbound
-
toString
-
equals
-
hashCode
public int hashCode() -
unsorted
Returns a sort order for unsorted tables.- Returns:
- an unsorted order
-
builderFor
Creates a newsort order builder
for the givenSchema
.- Parameters:
schema
- a schema- Returns:
- a sort order builder for the given schema
-
checkCompatibility
-