Skip to content
Closed
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
19 changes: 10 additions & 9 deletions src/iceberg/catalog.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -176,15 +176,6 @@
virtual Result<std::shared_ptr<Table>> RegisterTable(
const TableIdentifier& identifier, const std::string& metadata_file_location) = 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<class TableBuilder> BuildTable(
const TableIdentifier& identifier, const Schema& schema) const = 0;

/// \brief A builder used to create valid tables or start create/replace transactions
class TableBuilder {
public:
Expand Down Expand Up @@ -233,6 +224,16 @@
/// \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<class TableBuilder> BuildTable(
const TableIdentifier& identifier, const Schema& schema) const = 0;

};

} // namespace iceberg
2 changes: 1 addition & 1 deletion src/iceberg/catalog/in_memory_catalog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ Result<std::shared_ptr<Table>> InMemoryCatalog::RegisterTable(
return LoadTable(identifier);
}

std::unique_ptr<TableBuilder> InMemoryCatalog::BuildTable(
std::unique_ptr<iceberg::Catalog::TableBuilder> InMemoryCatalog::BuildTable(
const TableIdentifier& identifier, const Schema& schema) const {
throw IcebergError("not implemented");
}
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/catalog/in_memory_catalog.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -90,7 +90,7 @@
const TableIdentifier& identifier,
const std::string& metadata_file_location) override;

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

private:
Expand Down
Loading