1919
2020#pragma once
2121
22- #include < map>
2322#include < memory>
2423#include < string>
2524#include < string_view>
25+ #include < unordered_map>
2626#include < vector>
2727
28- #include " iceberg/error.h"
29- #include " iceberg/expected.h"
28+ #include " iceberg/result.h"
3029#include " iceberg/table_identifier.h"
3130#include " iceberg/type_fwd.h"
3231
@@ -48,8 +47,7 @@ class ICEBERG_EXPORT Catalog {
4847 // / \param ns a namespace
4948 // / \return a list of identifiers for tables or ErrorKind::kNoSuchNamespace
5049 // / if the namespace does not exist
51- virtual expected<std::vector<TableIdentifier>, Error> ListTables (
52- const Namespace& ns) const = 0;
50+ virtual Result<std::vector<TableIdentifier>> ListTables (const Namespace& ns) const = 0;
5351
5452 // / \brief Create a table
5553 // /
@@ -59,18 +57,18 @@ class ICEBERG_EXPORT Catalog {
5957 // / \param location a location for the table; leave empty if unspecified
6058 // / \param properties a string map of table properties
6159 // / \return a Table instance or ErrorKind::kAlreadyExists if the table already exists
62- virtual expected <std::unique_ptr<Table>, Error > CreateTable (
60+ virtual Result <std::unique_ptr<Table>> CreateTable (
6361 const TableIdentifier& identifier, const Schema& schema, const PartitionSpec& spec,
6462 const std::string& location,
65- const std::map <std::string, std::string>& properties) = 0;
63+ const std::unordered_map <std::string, std::string>& properties) = 0;
6664
6765 // / \brief Update a table
6866 // /
6967 // / \param identifier a table identifier
7068 // / \param requirements a list of table requirements
7169 // / \param updates a list of table updates
7270 // / \return a Table instance or ErrorKind::kAlreadyExists if the table already exists
73- virtual expected <std::unique_ptr<Table>, Error > UpdateTable (
71+ virtual Result <std::unique_ptr<Table>> UpdateTable (
7472 const TableIdentifier& identifier,
7573 const std::vector<std::unique_ptr<UpdateRequirement>>& requirements,
7674 const std::vector<std::unique_ptr<MetadataUpdate>>& updates) = 0;
@@ -84,10 +82,10 @@ class ICEBERG_EXPORT Catalog {
8482 // / \param properties a string map of table properties
8583 // / \return a Transaction to create the table or ErrorKind::kAlreadyExists if the table
8684 // / already exists
87- virtual expected <std::shared_ptr<Transaction>, Error > StageCreateTable (
85+ virtual Result <std::shared_ptr<Transaction>> StageCreateTable (
8886 const TableIdentifier& identifier, const Schema& schema, const PartitionSpec& spec,
8987 const std::string& location,
90- const std::map <std::string, std::string>& properties) = 0;
88+ const std::unordered_map <std::string, std::string>& properties) = 0;
9189
9290 // / \brief Check whether table exists
9391 // /
@@ -110,15 +108,15 @@ class ICEBERG_EXPORT Catalog {
110108 // / \param identifier a table identifier
111109 // / \return instance of Table implementation referred to by identifier or
112110 // / ErrorKind::kNoSuchTable if the table does not exist
113- virtual expected <std::shared_ptr<Table>, Error > LoadTable (
111+ virtual Result <std::shared_ptr<Table>> LoadTable (
114112 const TableIdentifier& identifier) const = 0;
115113
116114 // / \brief Register a table with the catalog if it does not exist
117115 // /
118116 // / \param identifier a table identifier
119117 // / \param metadata_file_location the location of a metadata file
120118 // / \return a Table instance or ErrorKind::kAlreadyExists if the table already exists
121- virtual expected <std::shared_ptr<Table>, Error > RegisterTable (
119+ virtual Result <std::shared_ptr<Table>> RegisterTable (
122120 const TableIdentifier& identifier, const std::string& metadata_file_location) = 0;
123121
124122 // / \brief Initialize a catalog given a custom name and a map of catalog properties
@@ -129,8 +127,9 @@ class ICEBERG_EXPORT Catalog {
129127 // /
130128 // / \param name a custom name for the catalog
131129 // / \param properties catalog properties
132- virtual void Initialize (const std::string& name,
133- const std::map<std::string, std::string>& properties) = 0;
130+ virtual void Initialize (
131+ const std::string& name,
132+ const std::unordered_map<std::string, std::string>& properties) = 0;
134133
135134 // / \brief Instantiate a builder to either create a table or start a create/replace
136135 // / transaction
@@ -169,7 +168,7 @@ class ICEBERG_EXPORT Catalog {
169168 // / \param properties key/value properties
170169 // / \return this for method chaining
171170 virtual TableBuilder& WithProperties (
172- const std::map <std::string, std::string>& properties) = 0;
171+ const std::unordered_map <std::string, std::string>& properties) = 0;
173172
174173 // / \brief Adds a key/value property to the table
175174 // /
0 commit comments