Package io.deephaven.iceberg.util
Interface SortOrderProvider
public interface SortOrderProvider
A specification for providing
SortOrder while writing to an iceberg table.-
Method Summary
Modifier and TypeMethodDescriptionstatic SortOrderProviderfromSortId(int id) Use the sort order with the given ID to sort new data while writing to the iceberg table.static SortOrderProviderfromSortOrder(org.apache.iceberg.SortOrder sortOrder) Use the given sort order directly to sort new data while writing to the iceberg table.static SortOrderProviderunsorted()Do not sort the data while writing new data to the iceberg table.static SortOrderProviderUse the defaultTable.sortOrder()of the table while writing new data.withFailOnUnmapped(boolean failOnUnmapped) Returns a sort order provider configured to fail (or not) if the sort order cannot be applied to the tables being written.withId(int sortOrderId) Returns a sort order provider that uses the current provider to determine the columns to sort on, but writes a different sort order ID to the Iceberg table.
-
Method Details
-
unsorted
Do not sort the data while writing new data to the iceberg table. -
useTableDefault
Use the defaultTable.sortOrder()of the table while writing new data. If no sort order is set on the table, no sorting will be done. -
fromSortId
Use the sort order with the given ID to sort new data while writing to the iceberg table. -
fromSortOrder
Use the given sort order directly to sort new data while writing to the iceberg table. Note that the provided sort order must either have a validSortOrder.orderId(), else this provider should be chained with anwithId(int)call to set a valid order ID. -
withId
Returns a sort order provider that uses the current provider to determine the columns to sort on, but writes a different sort order ID to the Iceberg table. Note that the sort order returned by the caller mustsatisfythe sort order corresponding to the provided sort order ID.For example, this provider might sort by columns {A, B, C}, but the ID written to Iceberg corresponds to a sort order with columns {A, B}.
- Parameters:
sortOrderId- the sort order ID to write to the iceberg table
-
withFailOnUnmapped
Returns a sort order provider configured to fail (or not) if the sort order cannot be applied to the tables being written. By default, all providers fail if the sort order cannot be applied.- Parameters:
failOnUnmapped- whether to fail if the sort order cannot be applied to the tables being written. Iffalseand the sort order cannot be applied, the tables will be written without sorting.
-