|
iceberg-cpp
|
Represents an Iceberg table. More...
#include <table.h>
Public Member Functions | |
| const TableIdentifier & | name () const |
| Returns the identifier of this table. | |
| const std::string & | full_name () const |
| Returns the fully-qualified name of this table. | |
| const std::string & | uuid () const |
| Returns the UUID of the table. | |
| Result< std::shared_ptr< Schema > > | schema () const |
| Returns the schema for this table, return NotFoundError if not found. | |
| Result< std::reference_wrapper< const std::unordered_map< int32_t, std::shared_ptr< Schema > > > > | schemas () const |
| Returns a map of schema for this table. | |
| Result< std::shared_ptr< PartitionSpec > > | spec () const |
| Returns the partition spec for this table, return NotFoundError if not found. | |
| Result< std::reference_wrapper< const std::unordered_map< int32_t, std::shared_ptr< PartitionSpec > > > > | specs () const |
| Returns a map of partition specs for this table. | |
| Result< std::shared_ptr< SortOrder > > | sort_order () const |
| Returns the sort order for this table, return NotFoundError if not found. | |
| Result< std::reference_wrapper< const std::unordered_map< int32_t, std::shared_ptr< SortOrder > > > > | sort_orders () const |
| Returns a map of sort order IDs to sort orders for this table. | |
| const TableProperties & | properties () const |
| Returns the properties of this table. | |
| std::string_view | metadata_file_location () const |
| Returns the table's metadata file location. | |
| std::string_view | location () const |
| Returns the table's base location. | |
| TimePointMs | last_updated_ms () const |
| Returns the time when this table was last updated. | |
| Result< std::shared_ptr< Snapshot > > | current_snapshot () const |
| Returns the table's current snapshot, return NotFoundError if not found. | |
| Result< std::shared_ptr< Snapshot > > | SnapshotById (int64_t snapshot_id) const |
| Get the snapshot of this table with the given id. | |
| const std::vector< std::shared_ptr< Snapshot > > & | snapshots () const |
| Get the snapshots of this table. | |
| const std::vector< SnapshotLogEntry > & | history () const |
| Get the snapshot history of this table. | |
| const std::shared_ptr< FileIO > & | io () const |
| Returns a FileIO to read and write table data and metadata files. | |
| const std::shared_ptr< TableMetadata > & | metadata () const |
| Returns the current metadata for this table. | |
| const std::shared_ptr< Catalog > & | catalog () const |
| Returns the catalog that this table belongs to. | |
| const std::shared_ptr< MetricsReporter > & | reporter () const |
| Returns the metrics reporter for this table. | |
| Result< std::unique_ptr< LocationProvider > > | location_provider () const |
| Returns a LocationProvider for this table. | |
| virtual Status | Refresh () |
| Refresh the current table metadata. | |
| virtual Result< std::unique_ptr< DataTableScanBuilder > > | NewScan () const |
| Create a new table scan builder for this table. | |
| virtual Result< std::unique_ptr< IncrementalAppendScanBuilder > > | NewIncrementalAppendScan () const |
| Create a new incremental append scan builder for this table. | |
| virtual Result< std::unique_ptr< IncrementalChangelogScanBuilder > > | NewIncrementalChangelogScan () const |
| Create a new incremental changelog scan builder for this table. | |
| virtual Result< std::shared_ptr< Transaction > > | NewTransaction () |
| Create a new Transaction to commit multiple table operations at once. | |
| virtual Result< std::shared_ptr< UpdatePartitionSpec > > | NewUpdatePartitionSpec () |
| Create a new UpdatePartitionSpec to update the partition spec of this table and commit the changes. | |
| virtual Result< std::shared_ptr< UpdateProperties > > | NewUpdateProperties () |
| Create a new UpdateProperties to update table properties and commit the changes. | |
| virtual Result< std::shared_ptr< UpdateSortOrder > > | NewUpdateSortOrder () |
| Create a new UpdateSortOrder to update the table sort order and commit the changes. | |
| virtual Result< std::shared_ptr< UpdateSchema > > | NewUpdateSchema () |
| Create a new UpdateSchema to alter the columns of this table and commit the changes. | |
| virtual Result< std::shared_ptr< ExpireSnapshots > > | NewExpireSnapshots () |
| Create a new ExpireSnapshots to remove expired snapshots and commit the changes. | |
| virtual Result< std::shared_ptr< UpdateStatistics > > | NewUpdateStatistics () |
| Create a new UpdateStatistics to update the table statistics and commit the changes. | |
| virtual Result< std::shared_ptr< UpdatePartitionStatistics > > | NewUpdatePartitionStatistics () |
| Create a new UpdatePartitionStatistics to update partition statistics and commit the changes. | |
| virtual Result< std::shared_ptr< UpdateLocation > > | NewUpdateLocation () |
| Create a new UpdateLocation to update the table location and commit the changes. | |
| virtual Result< std::shared_ptr< FastAppend > > | NewFastAppend () |
| Create a new FastAppend to append data files and commit the changes. | |
| virtual Result< std::shared_ptr< MergeAppend > > | NewMergeAppend () |
| Create a new MergeAppend to append data files and merge manifests. | |
| virtual Result< std::shared_ptr< DeleteFiles > > | NewDeleteFiles () |
| Create a new DeleteFiles to delete data files and commit the changes. | |
| virtual Result< std::shared_ptr< RowDelta > > | NewRowDelta () |
| Create a new RowDelta to add rows and row-level deletes. | |
| virtual Result< std::shared_ptr< OverwriteFiles > > | NewOverwrite () |
| Create a new OverwriteFiles to overwrite data files and commit the changes. | |
| virtual Result< std::shared_ptr< RewriteFiles > > | NewRewriteFiles () |
| Create a new RewriteFiles to replace files in this table and commit the changes. | |
| virtual Result< std::shared_ptr< SnapshotManager > > | NewSnapshotManager () |
| Create a new SnapshotManager to manage snapshots and snapshot references. | |
Static Public Member Functions | |
| static Result< std::shared_ptr< Table > > | Make (TableIdentifier identifier, std::shared_ptr< TableMetadata > metadata, std::string metadata_location, std::shared_ptr< FileIO > io, std::shared_ptr< Catalog > catalog, std::string full_name="", std::shared_ptr< MetricsReporter > reporter=nullptr) |
| Construct a table. | |
Protected Member Functions | |
| Table (TableIdentifier identifier, std::shared_ptr< TableMetadata > metadata, std::string metadata_location, std::shared_ptr< FileIO > io, std::shared_ptr< Catalog > catalog, std::string full_name, std::shared_ptr< MetricsReporter > reporter=nullptr) | |
Protected Attributes | |
| const TableIdentifier | identifier_ |
| const std::string | full_name_ |
| std::shared_ptr< TableMetadata > | metadata_ |
| std::string | metadata_location_ |
| std::shared_ptr< FileIO > | io_ |
| std::shared_ptr< Catalog > | catalog_ |
| std::shared_ptr< MetricsReporter > | reporter_ |
| std::unique_ptr< class TableMetadataCache > | metadata_cache_ |
Represents an Iceberg table.
|
static |
Construct a table.
| [in] | identifier | The identifier of the table. |
| [in] | metadata | The metadata for the table. |
| [in] | metadata_location | The location of the table metadata file. |
| [in] | io | The FileIO to read and write table data and metadata files. |
| [in] | catalog | The catalog that this table belongs to. |
| [in] | full_name | The fully-qualified name of this table. Defaults to the string representation of identifier when empty. |
| [in] | reporter | Optional metrics reporter for this table. Defaults to nullptr (noop). |
|
virtual |
Create a new DeleteFiles to delete data files and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new ExpireSnapshots to remove expired snapshots and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new FastAppend to append data files and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new MergeAppend to append data files and merge manifests.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new OverwriteFiles to overwrite data files and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new RewriteFiles to replace files in this table and commit the changes.
Reimplemented in iceberg::StaticTable.
Create a new RowDelta to add rows and row-level deletes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new table scan builder for this table.
Once a table scan builder is created, it can be refined to project columns and filter data.
Reimplemented in iceberg::StagedTable.
|
virtual |
Create a new SnapshotManager to manage snapshots and snapshot references.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new Transaction to commit multiple table operations at once.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new UpdateLocation to update the table location and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new UpdatePartitionSpec to update the partition spec of this table and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new UpdatePartitionStatistics to update partition statistics and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new UpdateProperties to update table properties and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new UpdateSchema to alter the columns of this table and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new UpdateSortOrder to update the table sort order and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Create a new UpdateStatistics to update the table statistics and commit the changes.
Reimplemented in iceberg::StaticTable.
|
virtual |
Refresh the current table metadata.
Reimplemented in iceberg::StagedTable, and iceberg::StaticTable.
Get the snapshot of this table with the given id.
| snapshot_id | the ID of the snapshot to get |