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

Updates table partition statistics. More...

#include <update_partition_statistics.h>

Inheritance diagram for iceberg::UpdatePartitionStatistics:
iceberg::PendingUpdate iceberg::ErrorCollector

Classes

struct  ApplyResult
 

Public Member Functions

UpdatePartitionStatistics & SetPartitionStatistics (std::shared_ptr< PartitionStatisticsFile > partition_statistics_file)
 Set partition statistics file for a snapshot.
 
UpdatePartitionStatistics & RemovePartitionStatistics (int64_t snapshot_id)
 Remove partition statistics for a snapshot.
 
Kind kind () const final
 Return the kind of this pending update.
 
bool IsRetryable () const override
 Partition statistics updates are intentionally not retried today.
 
Result< ApplyResult > Apply ()
 
- 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< UpdatePartitionStatistics > > 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

Updates table partition statistics.

Member Function Documentation

◆ IsRetryable()

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

Partition statistics updates are intentionally not retried today.

This matches the current Java SetPartitionStatistics behavior, which commits directly without a retry loop. Keep this conservative until we add explicit replay coverage for this update type.

Implements iceberg::PendingUpdate.

◆ kind()

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

Return the kind of this pending update.

Implements iceberg::PendingUpdate.

◆ RemovePartitionStatistics()

UpdatePartitionStatistics & iceberg::UpdatePartitionStatistics::RemovePartitionStatistics ( int64_t  snapshot_id)

Remove partition statistics for a snapshot.

Marks the partition statistics for the given snapshot ID for removal.

Parameters
snapshot_idThe snapshot ID whose partition statistics to remove
Returns
Reference to this UpdatePartitionStatistics for chaining

◆ SetPartitionStatistics()

UpdatePartitionStatistics & iceberg::UpdatePartitionStatistics::SetPartitionStatistics ( std::shared_ptr< PartitionStatisticsFile >  partition_statistics_file)

Set partition statistics file for a snapshot.

Associates a partition statistics file with a snapshot ID. If partition statistics already exist for this snapshot, they will be replaced.

Parameters
partition_statistics_fileThe partition statistics file to set
Returns
Reference to this UpdatePartitionStatistics for chaining

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