|
iceberg-cpp
|
SQL-backed Iceberg catalog. More...
#include <sql_catalog.h>
Public Member Functions | |
| SqlCatalog (const SqlCatalog &)=delete | |
| SqlCatalog & | operator= (const SqlCatalog &)=delete |
| SqlCatalog (SqlCatalog &&)=delete | |
| SqlCatalog & | operator= (SqlCatalog &&)=delete |
| std::string_view | name () const override |
| Return the name for this catalog. | |
| Status | CreateNamespace (const Namespace &ns, const std::unordered_map< std::string, std::string > &properties) override |
| Create a namespace with associated properties. | |
| Result< std::vector< Namespace > > | ListNamespaces (const Namespace &ns) const override |
| List child namespaces from the given namespace. | |
| Result< std::unordered_map< std::string, std::string > > | GetNamespaceProperties (const Namespace &ns) const override |
| Get metadata properties for a namespace. | |
| Status | DropNamespace (const Namespace &ns) override |
| Drop a namespace. | |
| Result< bool > | NamespaceExists (const Namespace &ns) const override |
| Check whether the namespace exists. | |
| Status | UpdateNamespaceProperties (const Namespace &ns, const std::unordered_map< std::string, std::string > &updates, const std::unordered_set< std::string > &removals) override |
| Update a namespace's properties by applying additions and removals. | |
| Result< std::vector< TableIdentifier > > | ListTables (const Namespace &ns) const override |
| Return all the identifiers under this namespace. | |
| 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) override |
| Create a table. | |
| 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) override |
| Update a table. | |
| 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) override |
| Start a transaction to create a table. | |
| Result< bool > | TableExists (const TableIdentifier &identifier) const override |
| Check whether table exists. | |
| Status | DropTable (const TableIdentifier &identifier, bool purge) override |
| Drop a table. | |
| Status | RenameTable (const TableIdentifier &from, const TableIdentifier &to) override |
| Rename a table. | |
| Result< std::shared_ptr< Table > > | LoadTable (const TableIdentifier &identifier) override |
| Load a table. | |
| Result< std::shared_ptr< Table > > | RegisterTable (const TableIdentifier &identifier, const std::string &metadata_file_location) override |
| Register a table with the catalog if it does not exist. | |
Static Public Member Functions | |
| static Result< std::shared_ptr< SqlCatalog > > | Make (const SqlCatalogConfig &config, std::shared_ptr< FileIO > file_io, std::shared_ptr< CatalogStore > store) |
Create a catalog backed by a user-supplied CatalogStore. | |
| static Result< std::shared_ptr< SqlCatalog > > | MakeSqliteCatalog (const SqlCatalogConfig &config, std::shared_ptr< FileIO > file_io) |
| Create a catalog backed by the built-in SQLite client. | |
| static Result< std::shared_ptr< SqlCatalog > > | MakePostgreSqlCatalog (const SqlCatalogConfig &config, std::shared_ptr< FileIO > file_io) |
| Create a catalog backed by the built-in PostgreSQL (libpq) client. | |
| static Result< std::shared_ptr< SqlCatalog > > | MakeMySqlCatalog (const SqlCatalogConfig &config, std::shared_ptr< FileIO > file_io) |
| Create a catalog backed by the built-in MySQL client. | |
SQL-backed Iceberg catalog.
|
overridevirtual |
Create a namespace with associated properties.
| ns | the namespace to create |
| properties | a key-value map of metadata for the namespace |
Implements iceberg::Catalog.
|
overridevirtual |
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 |
Implements iceberg::Catalog.
|
overridevirtual |
Drop a namespace.
| ns | the namespace to drop |
Implements iceberg::Catalog.
|
overridevirtual |
Drop a table.
SqlCatalog currently removes only the catalog entry. Support for deleting table data and metadata files when purge is true is not implemented yet.
Implements iceberg::Catalog.
|
overridevirtual |
Get metadata properties for a namespace.
| ns | the namespace to look up |
Implements iceberg::Catalog.
|
overridevirtual |
List child namespaces from the given namespace.
| ns | the parent namespace |
Implements iceberg::Catalog.
|
overridevirtual |
Return all the identifiers under this namespace.
| ns | a namespace |
Implements iceberg::Catalog.
|
overridevirtual |
Load a table.
| identifier | a table identifier |
Implements iceberg::Catalog.
|
static |
Create a catalog backed by a user-supplied CatalogStore.
This is the extension point for custom databases/drivers: implement CatalogStore and pass it here. The catalog initializes its schema (creating the backing tables if they do not exist) before returning.
| config | Catalog configuration (name and warehouse location are used; uri is informational because the store is already constructed). |
| file_io | File IO used to read and write table metadata files. |
| store | The catalog metadata store. Must not be null. |
|
static |
Create a catalog backed by the built-in MySQL client.
| config | uri is parsed as [scheme://][user[:password]@]host[:port][/database]. |
| file_io | File IO used to read and write table metadata files. |
|
static |
Create a catalog backed by the built-in PostgreSQL (libpq) client.
| config | uri is parsed as [scheme://][user[:password]@]host[:port][/database]. |
| file_io | File IO used to read and write table metadata files. |
|
static |
Create a catalog backed by the built-in SQLite client.
| config | uri is the SQLite database file path (or ":memory:"). |
| file_io | File IO used to read and write table metadata files. |
|
overridevirtual |
Return the name for this catalog.
Implements iceberg::Catalog.
|
overridevirtual |
Check whether the namespace exists.
| ns | the namespace to check |
Implements iceberg::Catalog.
|
overridevirtual |
Register a table with the catalog if it does not exist.
| identifier | a table identifier |
| metadata_file_location | the location of a metadata file |
Implements iceberg::Catalog.
|
overridevirtual |
Rename a table.
| from | the current table identifier |
| to | the new table identifier |
Implements iceberg::Catalog.
|
overridevirtual |
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 |
Implements iceberg::Catalog.
|
overridevirtual |
Check whether table exists.
| identifier | a table identifier |
Implements iceberg::Catalog.
|
overridevirtual |
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 |
Implements iceberg::Catalog.
|
overridevirtual |
Update a table.
| identifier | a table identifier |
| requirements | a list of table requirements |
| updates | a list of table updates |
Implements iceberg::Catalog.