Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions src/iceberg/catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,64 +184,6 @@ class ICEBERG_EXPORT Catalog {
/// \return a Table instance or ErrorKind::kAlreadyExists if the table already exists
virtual Result<std::shared_ptr<Table>> RegisterTable(
const TableIdentifier& identifier, const std::string& metadata_file_location) = 0;

/// \brief A builder used to create valid tables or start create/replace transactions
class TableBuilder {
public:
virtual ~TableBuilder() = default;

/// \brief Sets a partition spec for the table
///
/// \param spec a partition spec
/// \return this for method chaining
virtual TableBuilder& WithPartitionSpec(const PartitionSpec& spec) = 0;

/// \brief Sets a sort order for the table
///
/// \param sort_order a sort order
/// \return this for method chaining
virtual TableBuilder& WithSortOrder(const SortOrder& sort_order) = 0;

/// \brief Sets a location for the table
///
/// \param location a location
/// \return this for method chaining
virtual TableBuilder& WithLocation(const std::string& location) = 0;

/// \brief Adds key/value properties to the table
///
/// \param properties key/value properties
/// \return this for method chaining
virtual TableBuilder& WithProperties(
const std::unordered_map<std::string, std::string>& properties) = 0;

/// \brief Adds a key/value property to the table
///
/// \param key a key
/// \param value a value
/// \return this for method chaining
virtual TableBuilder& WithProperty(const std::string& key,
const std::string& value) = 0;

/// \brief Creates the table
///
/// \return the created table
virtual std::unique_ptr<Table> Create() = 0;

/// \brief Starts a transaction to create the table
///
/// \return the Transaction to create the table
virtual std::unique_ptr<Transaction> StageCreate() = 0;
};

/// \brief Instantiate a builder to either create a table or start a create/replace
/// transaction
///
/// \param identifier a table identifier
/// \param schema a schema
/// \return the builder to create a table or start a create/replace transaction
virtual std::unique_ptr<TableBuilder> BuildTable(const TableIdentifier& identifier,
const Schema& schema) const = 0;
};

} // namespace iceberg
6 changes: 0 additions & 6 deletions src/iceberg/catalog/memory/in_memory_catalog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ Status InMemoryCatalog::DropTable(const TableIdentifier& identifier, bool purge)

Status InMemoryCatalog::RenameTable(const TableIdentifier& from,
const TableIdentifier& to) {
std::unique_lock lock(mutex_);
return NotImplemented("rename table");
}

Expand Down Expand Up @@ -454,9 +453,4 @@ Result<std::shared_ptr<Table>> InMemoryCatalog::RegisterTable(
return LoadTable(identifier);
}

std::unique_ptr<Catalog::TableBuilder> InMemoryCatalog::BuildTable(
const TableIdentifier& identifier, const Schema& schema) const {
throw IcebergError("not implemented");
}

} // namespace iceberg
3 changes: 0 additions & 3 deletions src/iceberg/catalog/memory/in_memory_catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ class ICEBERG_EXPORT InMemoryCatalog
const TableIdentifier& identifier,
const std::string& metadata_file_location) override;

std::unique_ptr<TableBuilder> BuildTable(const TableIdentifier& identifier,
const Schema& schema) const override;

private:
std::string catalog_name_;
std::unordered_map<std::string, std::string> properties_;
Expand Down
6 changes: 0 additions & 6 deletions src/iceberg/catalog/rest/rest_catalog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,4 @@ Result<std::shared_ptr<Table>> RestCatalog::RegisterTable(
return NotImplemented("Not implemented");
}

std::unique_ptr<RestCatalog::TableBuilder> RestCatalog::BuildTable(
[[maybe_unused]] const TableIdentifier& identifier,
[[maybe_unused]] const Schema& schema) const {
return nullptr;
}

} // namespace iceberg::rest
3 changes: 0 additions & 3 deletions src/iceberg/catalog/rest/rest_catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ class ICEBERG_REST_EXPORT RestCatalog : public Catalog {
const TableIdentifier& identifier,
const std::string& metadata_file_location) override;

std::unique_ptr<RestCatalog::TableBuilder> BuildTable(
const TableIdentifier& identifier, const Schema& schema) const override;

private:
RestCatalog(std::unique_ptr<RestCatalogProperties> config,
std::unique_ptr<ResourcePaths> paths);
Expand Down
3 changes: 0 additions & 3 deletions src/iceberg/test/mock_catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ class MockCatalog : public Catalog {

MOCK_METHOD((Result<std::shared_ptr<Table>>), RegisterTable,
(const TableIdentifier&, const std::string&), (override));

MOCK_METHOD((std::unique_ptr<TableBuilder>), BuildTable,
(const TableIdentifier&, const Schema&), (const, override));
};

} // namespace iceberg
Loading