|
iceberg-cpp
|
A sort order for a table. More...
#include <sort_order.h>
Public Member Functions | |
| int32_t | order_id () const |
| Get the sort order id. | |
| std::span< const SortField > | fields () const |
| Get the list of sort fields. | |
| bool | is_sorted () const |
| Returns true if the sort order is sorted. | |
| bool | is_unsorted () const |
| Returns true if the sort order is unsorted A SortOrder is unsorted if it has no sort fields. | |
| bool | Satisfies (const SortOrder &other) const |
| Checks whether this order satisfies another order. | |
| bool | SameOrder (const SortOrder &other) const |
| Checks whether this order is equivalent to another order while ignoring the order id. | |
| std::string | ToString () const override |
| Get a user-readable string representation. | |
| Status | Validate (const Schema &schema) const |
| Validates the sort order against a schema. | |
Static Public Member Functions | |
| static const std::shared_ptr< SortOrder > & | Unsorted () |
| Get an unsorted sort order singleton. | |
| static Result< std::unique_ptr< SortOrder > > | Make (const Schema &schema, int32_t sort_id, std::vector< SortField > fields) |
| Create a SortOrder. | |
| static Result< std::unique_ptr< SortOrder > > | Make (int32_t sort_id, std::vector< SortField > fields) |
| Create a SortOrder without binding to a schema. | |
| static std::unordered_set< std::string_view > | OrderPreservingSortedColumns (const Schema &schema, const SortOrder &order) |
Static Public Attributes | |
| static constexpr int32_t | kUnsortedOrderId = 0 |
| static constexpr int32_t | kInitialSortOrderId = 1 |
Friends | |
| bool | operator== (const SortOrder &lhs, const SortOrder &rhs) |
A sort order for a table.
A sort order is defined by a sort order id and a list of sort fields. The order of the sort fields within the list defines the order in which the sort is applied to the data.
|
overridevirtual |
Get a user-readable string representation.
Implements iceberg::util::Formattable.
| Status iceberg::SortOrder::Validate | ( | const Schema & | schema | ) | const |
Validates the sort order against a schema.
| schema | The schema to validate against. |