25#include <unordered_map>
26#include <unordered_set>
29#include "iceberg/result.h"
44 virtual std::string_view
name()
const = 0;
55 const std::unordered_map<std::string, std::string>& properties) = 0;
95 const Namespace& ns,
const std::unordered_map<std::string, std::string>& updates,
96 const std::unordered_set<std::string>& removals) = 0;
115 const TableIdentifier& identifier,
const std::shared_ptr<Schema>& schema,
116 const std::shared_ptr<PartitionSpec>& spec,
const std::shared_ptr<SortOrder>& order,
117 const std::string& location,
118 const std::unordered_map<std::string, std::string>& properties) = 0;
128 const std::vector<std::unique_ptr<TableRequirement>>& requirements,
129 const std::vector<std::unique_ptr<TableUpdate>>& updates) = 0;
142 const TableIdentifier& identifier,
const std::shared_ptr<Schema>& schema,
143 const std::shared_ptr<PartitionSpec>& spec,
const std::shared_ptr<SortOrder>& order,
144 const std::string& location,
145 const std::unordered_map<std::string, std::string>& properties) = 0;
190 const TableIdentifier& identifier,
const std::string& metadata_file_location) = 0;
A Catalog API for table create, drop, and load operations.
Definition catalog.h:39
virtual Result< bool > NamespaceExists(const Namespace &ns) const =0
Check whether the namespace exists.
virtual Status DropTable(const TableIdentifier &identifier, bool purge)=0
Drop a table; optionally delete data and metadata files.
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< 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 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::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 std::string_view name() const =0
Return the name for this catalog.
virtual Status DropNamespace(const Namespace &ns)=0
Drop a namespace.
virtual Result< bool > TableExists(const TableIdentifier &identifier) const =0
Check whether table exists.
virtual Result< std::shared_ptr< Table > > LoadTable(const TableIdentifier &identifier)=0
Load a table.
virtual Result< std::vector< TableIdentifier > > ListTables(const Namespace &ns) const =0
Return all the identifiers under this namespace.
virtual Result< std::vector< Namespace > > ListNamespaces(const Namespace &ns) const =0
List child namespaces from the given namespace.
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.
virtual Status RenameTable(const TableIdentifier &from, const TableIdentifier &to)=0
Rename a table.
virtual Result< std::unordered_map< std::string, std::string > > GetNamespaceProperties(const Namespace &ns) const =0
Get metadata properties for a namespace.
virtual Status CreateNamespace(const Namespace &ns, const std::unordered_map< std::string, std::string > &properties)=0
Create a namespace with associated properties.
A namespace in a catalog.
Definition table_identifier.h:35
Identifies a table in iceberg catalog.
Definition table_identifier.h:46