|
iceberg-cpp
|
A Catalog API for table create, drop, and load operations. More...
#include <catalog.h>
Public Member Functions | |
| virtual std::string_view | name () const =0 |
| Return the name for this catalog. | |
| virtual Status | CreateNamespace (const Namespace &ns, const std::unordered_map< std::string, std::string > &properties)=0 |
| Create a namespace with associated properties. | |
| virtual Result< std::vector< Namespace > > | ListNamespaces (const Namespace &ns) const =0 |
| List child namespaces from the given namespace. | |
| virtual Result< std::unordered_map< std::string, std::string > > | GetNamespaceProperties (const Namespace &ns) const =0 |
| Get metadata properties for a namespace. | |
| virtual Status | DropNamespace (const Namespace &ns)=0 |
| Drop a namespace. | |
| virtual Result< bool > | NamespaceExists (const Namespace &ns) const =0 |
| Check whether the namespace exists. | |
| virtual Status | UpdateNamespaceProperties (const Namespace &ns, const std::unordered_map< std::string, std::string > &updates, const std::unordered_set< std::string > &removals)=0 |
| Update a namespace's properties by applying additions and removals. | |
| virtual Result< std::vector< TableIdentifier > > | ListTables (const Namespace &ns) const =0 |
| Return all the identifiers under this namespace. | |
| virtual Result< std::shared_ptr< Table > > | CreateTable (const TableIdentifier &identifier, const std::shared_ptr< Schema > &schema, const std::shared_ptr< PartitionSpec > &spec, const std::shared_ptr< SortOrder > &order, const std::string &location, const std::unordered_map< std::string, std::string > &properties)=0 |
| Create a table. | |
| virtual Result< std::shared_ptr< Table > > | UpdateTable (const TableIdentifier &identifier, const std::vector< std::unique_ptr< TableRequirement > > &requirements, const std::vector< std::unique_ptr< TableUpdate > > &updates)=0 |
| Update a table. | |
| virtual Result< std::shared_ptr< Transaction > > | StageCreateTable (const TableIdentifier &identifier, const std::shared_ptr< Schema > &schema, const std::shared_ptr< PartitionSpec > &spec, const std::shared_ptr< SortOrder > &order, const std::string &location, const std::unordered_map< std::string, std::string > &properties)=0 |
| Start a transaction to create a table. | |
| virtual Result< bool > | TableExists (const TableIdentifier &identifier) const =0 |
| Check whether table exists. | |
| virtual Status | DropTable (const TableIdentifier &identifier, bool purge)=0 |
| Drop a table; optionally delete data and metadata files. | |
| virtual Status | RenameTable (const TableIdentifier &from, const TableIdentifier &to)=0 |
| Rename a table. | |
| virtual Result< std::shared_ptr< Table > > | LoadTable (const TableIdentifier &identifier)=0 |
| Load a table. | |
| virtual Result< std::shared_ptr< Table > > | RegisterTable (const TableIdentifier &identifier, const std::string &metadata_file_location)=0 |
| Register a table with the catalog if it does not exist. | |
A Catalog API for table create, drop, and load operations.
Note that these functions are named after the corresponding operationId specified by the Iceberg Rest Catalog API.
|
pure virtual |
Create a namespace with associated properties.
| ns | the namespace to create |
| properties | a key-value map of metadata for the namespace |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Create a table.
| identifier | a table identifier |
| schema | a schema |
| spec | a partition spec |
| order | a sort order |
| location | a location for the table; leave empty if unspecified |
| properties | a string map of table properties |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Drop a namespace.
| ns | the namespace to drop |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Drop a table; optionally delete data and metadata files.
If purge is set to true the implementation should delete all data and metadata files.
| identifier | a table identifier |
| purge | if true, delete all data and metadata files in the table |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Get metadata properties for a namespace.
| ns | the namespace to look up |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
List child namespaces from the given namespace.
| ns | the parent namespace |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Return all the identifiers under this namespace.
| ns | a namespace |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Load a table.
| identifier | a table identifier |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Return the name for this catalog.
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Check whether the namespace exists.
| ns | the namespace to check |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Register a table with the catalog if it does not exist.
| identifier | a table identifier |
| metadata_file_location | the location of a metadata file |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Rename a table.
| from | the current table identifier |
| to | the new table identifier |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Start a transaction to create a table.
| identifier | a table identifier |
| schema | a schema |
| spec | a partition spec |
| order | a sort order |
| location | a location for the table; leave empty if unspecified |
| properties | a string map of table properties |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Check whether table exists.
| identifier | a table identifier |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Update a namespace's properties by applying additions and removals.
| ns | the namespace to update |
| updates | a set of properties to add or overwrite |
| removals | a set of property keys to remove |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.
|
pure virtual |
Update a table.
| identifier | a table identifier |
| requirements | a list of table requirements |
| updates | a list of table updates |
Implemented in iceberg::InMemoryCatalog, and iceberg::rest::RestCatalog.