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

Represents an Iceberg table. More...

#include <table.h>

Inheritance diagram for iceberg::Table:
iceberg::StagedTable iceberg::StaticTable

Public Member Functions

const TableIdentifiername () const
 Returns the identifier 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 TablePropertiesproperties () 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.
 
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< 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)
 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)
 

Protected Attributes

const TableIdentifier identifier_
 
std::shared_ptr< TableMetadatametadata_
 
std::string metadata_location_
 
std::shared_ptr< FileIOio_
 
std::shared_ptr< Catalogcatalog_
 
std::unique_ptr< class TableMetadataCachemetadata_cache_
 

Detailed Description

Represents an Iceberg table.

Member Function Documentation

◆ Make()

Result< std::shared_ptr< Table > > iceberg::Table::Make ( TableIdentifier  identifier,
std::shared_ptr< TableMetadata metadata,
std::string  metadata_location,
std::shared_ptr< FileIO io,
std::shared_ptr< Catalog catalog 
)
static

Construct a table.

Parameters
[in]identifierThe identifier of the table.
[in]metadataThe metadata for the table.
[in]metadata_locationThe location of the table metadata file.
[in]ioThe FileIO to read and write table data and metadata files.
[in]catalogThe catalog that this table belongs to.

◆ NewScan()

Result< std::unique_ptr< DataTableScanBuilder > > iceberg::Table::NewScan ( ) const
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.

◆ NewTransaction()

Result< std::shared_ptr< Transaction > > iceberg::Table::NewTransaction ( )
virtual

Create a new Transaction to commit multiple table operations at once.

Reimplemented in iceberg::StaticTable.

◆ NewUpdateProperties()

Result< std::shared_ptr< UpdateProperties > > iceberg::Table::NewUpdateProperties ( )
virtual

Create a new UpdateProperties to update table properties and commit the changes.

Reimplemented in iceberg::StaticTable.

◆ NewUpdateSchema()

Result< std::shared_ptr< UpdateSchema > > iceberg::Table::NewUpdateSchema ( )
virtual

Create a new UpdateSchema to alter the columns of this table and commit the changes.

Reimplemented in iceberg::StaticTable.

◆ Refresh()

Status iceberg::Table::Refresh ( )
virtual

Refresh the current table metadata.

Reimplemented in iceberg::StagedTable, and iceberg::StaticTable.

◆ SnapshotById()

Result< std::shared_ptr< Snapshot > > iceberg::Table::SnapshotById ( int64_t  snapshot_id) const

Get the snapshot of this table with the given id.

Parameters
snapshot_idthe ID of the snapshot to get
Returns
the Snapshot with the given id, return NotFoundError if not found

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