24#include <unordered_set>
42 public std::enable_shared_from_this<HiveCatalog> {
58 std::string_view
name()
const override;
62 const std::unordered_map<std::string, std::string>& properties)
override;
74 const Namespace& ns,
const std::unordered_map<std::string, std::string>& updates,
75 const std::unordered_set<std::string>& removals)
override;
80 const TableIdentifier& identifier,
const std::shared_ptr<Schema>& schema,
81 const std::shared_ptr<PartitionSpec>& spec,
const std::shared_ptr<SortOrder>& order,
82 const std::string& location,
83 const std::unordered_map<std::string, std::string>& properties)
override;
87 const std::vector<std::unique_ptr<TableRequirement>>& requirements,
88 const std::vector<std::unique_ptr<TableUpdate>>& updates)
override;
91 const TableIdentifier& identifier,
const std::shared_ptr<Schema>& schema,
92 const std::shared_ptr<PartitionSpec>& spec,
const std::shared_ptr<SortOrder>& order,
93 const std::string& location,
94 const std::unordered_map<std::string, std::string>& properties)
override;
106 const std::string& metadata_file_location)
override;
Define the catalog API for table and namespace operations.
A Catalog API for table create, drop, and load operations.
Definition catalog.h:42
Configuration for the iceberg_hive HiveCatalog.
Definition hive_catalog_properties.h:47
Catalog implementation backed by a Hive Metastore.
Definition hive_catalog.h:42
Result< bool > TableExists(const TableIdentifier &identifier) const override
Check whether table exists.
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.
Status DropTable(const TableIdentifier &identifier, bool purge) override
Drop a table; optionally delete data and metadata files.
Result< std::shared_ptr< Table > > LoadTable(const TableIdentifier &identifier) override
Load a table.
Result< std::vector< TableIdentifier > > ListTables(const Namespace &ns) const override
Return all the identifiers under this namespace.
Status RenameTable(const TableIdentifier &from, const TableIdentifier &to) override
Rename a table.
Result< bool > NamespaceExists(const Namespace &ns) const override
Check whether the namespace exists.
Status DropNamespace(const Namespace &ns) override
Drop a namespace.
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< 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.
Result< std::unordered_map< std::string, std::string > > GetNamespaceProperties(const Namespace &ns) const override
Get metadata properties for a namespace.
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.
Status CreateNamespace(const Namespace &ns, const std::unordered_map< std::string, std::string > &properties) override
Create a namespace with associated properties.
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.
std::string_view name() const override
Return the name for this catalog.
Result< std::vector< Namespace > > ListNamespaces(const Namespace &ns) const override
List child namespaces from the given namespace.
static Result< std::shared_ptr< HiveCatalog > > Make(const HiveCatalogProperties &config)
Construct a HiveCatalog from config.
Configuration for connecting to a Hive Metastore (HMS) over Thrift.
Define symbol visibility macros for the Hive catalog library.
Hive catalog APIs.
Definition hive_catalog.h:34
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.
A namespace in a catalog.
Definition table_identifier.h:35
Identifies a table in iceberg catalog.
Definition table_identifier.h:46