iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
iceberg::UpdateSortOrder Class Reference

Updating table sort order with a newly created order. More...

#include <update_sort_order.h>

Inheritance diagram for iceberg::UpdateSortOrder:
iceberg::PendingUpdate iceberg::ErrorCollector

Public Member Functions

UpdateSortOrder & AddSortField (const std::shared_ptr< Term > &term, SortDirection direction, NullOrder null_order)
 Add a sort field to the sort order.
 
UpdateSortOrder & AddSortFieldByName (std::string_view name, SortDirection direction, NullOrder null_order)
 Add a sort field by field name with identity transform.
 
UpdateSortOrder & CaseSensitive (bool case_sensitive)
 Set case sensitivity of sort column name resolution.
 
Kind kind () const final
 Return the kind of this pending update.
 
bool IsRetryable () const override
 Whether this update can be retried after a commit conflict.
 
Result< std::shared_ptr< SortOrder > > Apply ()
 Apply the pending changes and return the new SortOrder.
 
- Public Member Functions inherited from iceberg::PendingUpdate
virtual Status Commit ()
 Apply the pending changes and commit.
 
 PendingUpdate (const PendingUpdate &)=delete
 
PendingUpdate & operator= (const PendingUpdate &)=delete
 
 PendingUpdate (PendingUpdate &&)=delete
 
PendingUpdate & operator= (PendingUpdate &&)=delete
 
- Public Member Functions inherited from iceberg::ErrorCollector
 ErrorCollector (ErrorCollector &&)=default
 
ErrorCollector & operator= (ErrorCollector &&)=default
 
 ErrorCollector (const ErrorCollector &)=default
 
ErrorCollector & operator= (const ErrorCollector &)=default
 
template<typename... Args>
auto & AddError (this auto &self, ErrorKind kind, const std::format_string< Args... > fmt, Args &&... args)
 Add a specific error.
 
auto & AddError (this auto &self, Error err)
 Add an existing error object.
 
auto & AddError (this auto &self, ::iceberg::unexpected< Error > err)
 Add an unexpected result's error.
 
auto & AddError (this auto &self, std::unexpected< Error > err)
 
bool has_errors () const
 Check if any errors have been collected.
 
size_t error_count () const
 Get the number of errors collected.
 
Status CheckErrors () const
 Check for accumulated errors and return them if any exist.
 
void ClearErrors ()
 Clear all accumulated errors.
 
const std::vector< Error > & errors () const
 Get read-only access to all collected errors.
 

Static Public Member Functions

static Result< std::shared_ptr< UpdateSortOrder > > Make (std::shared_ptr< TransactionContext > ctx)
 

Additional Inherited Members

- Public Types inherited from iceberg::PendingUpdate
enum class  Kind : uint8_t {
  kExpireSnapshots , kSetSnapshot , kUpdateLocation , kUpdatePartitionSpec ,
  kUpdatePartitionStatistics , kUpdateProperties , kUpdateSchema , kUpdateSnapshot ,
  kUpdateSnapshotReference , kUpdateSortOrder , kUpdateStatistics
}
 
- Protected Member Functions inherited from iceberg::PendingUpdate
 PendingUpdate (std::shared_ptr< TransactionContext > ctx)
 
const TableMetadata & base () const
 
Status CheckCommitAllowed () const
 
virtual Status CleanStaged ()
 Discard this generation's staging, retaining applied operation intent.
 
virtual Status Finalize (const TableMetadata &committed)
 Complete a known successful commit. Called only by Transaction with the final committed table metadata.
 
- Protected Attributes inherited from iceberg::PendingUpdate
std::shared_ptr< TransactionContext > ctx_
 
- Protected Attributes inherited from iceberg::ErrorCollector
std::vector< Error > errors_
 

Detailed Description

Updating table sort order with a newly created order.

Member Function Documentation

◆ AddSortField()

UpdateSortOrder & iceberg::UpdateSortOrder::AddSortField ( const std::shared_ptr< Term > &  term,
SortDirection  direction,
NullOrder  null_order 
)

Add a sort field to the sort order.

Parameters
termA transform term referencing the field
directionThe sort direction (ascending or descending)
null_orderThe null order (first or last)
Returns
Reference to this UpdateSortOrder for chaining

◆ AddSortFieldByName()

UpdateSortOrder & iceberg::UpdateSortOrder::AddSortFieldByName ( std::string_view  name,
SortDirection  direction,
NullOrder  null_order 
)

Add a sort field by field name with identity transform.

Parameters
nameThe name of the field to sort by
directionThe sort direction (ascending or descending)
null_orderThe null order (first or last)
Returns
Reference to this UpdateSortOrder for chaining

◆ CaseSensitive()

UpdateSortOrder & iceberg::UpdateSortOrder::CaseSensitive ( bool  case_sensitive)

Set case sensitivity of sort column name resolution.

Parameters
case_sensitiveWhen true, column name resolution is case-sensitive
Returns
Reference to this UpdateSortOrder for chaining

◆ IsRetryable()

bool iceberg::UpdateSortOrder::IsRetryable ( ) const
inlineoverridevirtual

Whether this update can be retried after a commit conflict.

Implements iceberg::PendingUpdate.

◆ kind()

Kind iceberg::UpdateSortOrder::kind ( ) const
inlinefinalvirtual

Return the kind of this pending update.

Implements iceberg::PendingUpdate.


The documentation for this class was generated from the following file: