|
iceberg-cpp
|
API for partition spec evolution. More...
#include <update_partition_spec.h>
Classes | |
| struct | ApplyResult |
Public Member Functions | |
| UpdatePartitionSpec & | CaseSensitive (bool is_case_sensitive) |
| Set whether column resolution in the source schema should be case sensitive. | |
| UpdatePartitionSpec & | AddField (std::string_view source_name) |
| Add a new partition field from a source column. | |
| UpdatePartitionSpec & | AddField (const std::shared_ptr< Term > &term, std::string_view part_name="") |
| Add a new partition field with a custom name. | |
| UpdatePartitionSpec & | RemoveField (std::string_view name) |
| Remove a partition field by name. | |
| UpdatePartitionSpec & | RemoveField (const std::shared_ptr< Term > &term) |
| Remove a partition field by its source term. | |
| UpdatePartitionSpec & | RenameField (std::string_view name, std::string new_name) |
| Rename a field in the partition spec. | |
| UpdatePartitionSpec & | AddNonDefaultSpec () |
| Sets that the new partition spec will NOT be set as the default. | |
| Kind | kind () const final |
| Return the kind of this pending update. | |
| bool | IsRetryable () const override |
| Partition spec updates are not retryable. | |
| Result< ApplyResult > | Apply () |
Public Member Functions inherited from iceberg::PendingUpdate | |
| virtual Status | Commit () |
| Apply the pending changes and commit. | |
| virtual Status | Finalize (Result< const TableMetadata * > commit_result) |
| Finalize the pending update. | |
| PendingUpdate (const PendingUpdate &)=delete | |
| PendingUpdate & | operator= (const PendingUpdate &)=delete |
| PendingUpdate (PendingUpdate &&) noexcept=default | |
| PendingUpdate & | operator= (PendingUpdate &&) noexcept=default |
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 and return reference to derived class. | |
| auto & | AddError (this auto &self, Error err) |
| Add an existing error object and return reference to derived class. | |
| auto & | AddError (this auto &self, std::unexpected< Error > err) |
| Add an unexpected result's error and return reference to derived class. | |
| 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< UpdatePartitionSpec > > | 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 |
Protected Attributes inherited from iceberg::PendingUpdate | |
| std::shared_ptr< TransactionContext > | ctx_ |
Protected Attributes inherited from iceberg::ErrorCollector | |
| std::vector< Error > | errors_ |
API for partition spec evolution.
When committing, these changes will be applied to the current table metadata. Commit conflicts will not be resolved and will result in a CommitFailed error.
| UpdatePartitionSpec & iceberg::UpdatePartitionSpec::AddField | ( | const std::shared_ptr< Term > & | term, |
| std::string_view | part_name = "" |
||
| ) |
Add a new partition field with a custom name.
| term | The term representing the source column, should be unbound. |
| part_name | Name for the partition field. |
| UpdatePartitionSpec & iceberg::UpdatePartitionSpec::AddField | ( | std::string_view | source_name | ) |
Add a new partition field from a source column.
The partition field will use identity transform on the source column, and use source column name as the partition field name.
| source_name | Source column name in the table schema. |
| UpdatePartitionSpec & iceberg::UpdatePartitionSpec::AddNonDefaultSpec | ( | ) |
Sets that the new partition spec will NOT be set as the default.
The default behavior is to set the new spec as the default partition spec.
|
inlineoverridevirtual |
Partition spec updates are not retryable.
The update caches the current schema/spec state and may allocate or recycle partition field IDs from that base. Replaying after a refresh can change the intended transform bindings or field ID assignment semantics.
Implements iceberg::PendingUpdate.
|
inlinefinalvirtual |
Return the kind of this pending update.
Implements iceberg::PendingUpdate.
| UpdatePartitionSpec & iceberg::UpdatePartitionSpec::RemoveField | ( | const std::shared_ptr< Term > & | term | ) |
Remove a partition field by its source term.
The partition field with the same transform and source reference will be removed. If the term is a reference and does not have a transform, identity transform is used.
| term | The term representing the source column, should be unbound. |
| UpdatePartitionSpec & iceberg::UpdatePartitionSpec::RemoveField | ( | std::string_view | name | ) |
Remove a partition field by name.
| name | Name of the partition field to remove. |
| UpdatePartitionSpec & iceberg::UpdatePartitionSpec::RenameField | ( | std::string_view | name, |
| std::string | new_name | ||
| ) |
Rename a field in the partition spec.
| name | Name of the partition field to rename. |
| new_name | Replacement name for the partition field. |