Skip to content

Commit 6f5daed

Browse files
author
shuxu.li
committed
feat: Refresh method support for table
1 parent 7f50025 commit 6f5daed

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/iceberg/catalog.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ namespace iceberg {
3838
/// specified by the Iceberg Rest Catalog API.
3939
class ICEBERG_EXPORT Catalog {
4040
public:
41-
class TableBuilder;
42-
4341
virtual ~Catalog() = default;
4442

4543
/// \brief Return the name for this catalog
@@ -178,15 +176,6 @@ class ICEBERG_EXPORT Catalog {
178176
virtual Result<std::shared_ptr<Table>> RegisterTable(
179177
const TableIdentifier& identifier, const std::string& metadata_file_location) = 0;
180178

181-
/// \brief Instantiate a builder to either create a table or start a create/replace
182-
/// transaction
183-
///
184-
/// \param identifier a table identifier
185-
/// \param schema a schema
186-
/// \return the builder to create a table or start a create/replace transaction
187-
virtual std::unique_ptr<TableBuilder> BuildTable(const TableIdentifier& identifier,
188-
const Schema& schema) const = 0;
189-
190179
/// \brief A builder used to create valid tables or start create/replace transactions
191180
class TableBuilder {
192181
public:
@@ -235,6 +224,15 @@ class ICEBERG_EXPORT Catalog {
235224
/// \return the Transaction to create the table
236225
virtual std::unique_ptr<Transaction> StageCreate() = 0;
237226
};
227+
228+
/// \brief Instantiate a builder to either create a table or start a create/replace
229+
/// transaction
230+
///
231+
/// \param identifier a table identifier
232+
/// \param schema a schema
233+
/// \return the builder to create a table or start a create/replace transaction
234+
virtual std::unique_ptr<TableBuilder> BuildTable(const TableIdentifier& identifier,
235+
const Schema& schema) const = 0;
238236
};
239237

240238
} // namespace iceberg

test/mock_catalog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class MockCatalog : public Catalog {
7878
MOCK_METHOD((Result<std::shared_ptr<Table>>), RegisterTable,
7979
(const TableIdentifier&, const std::string&), (override));
8080

81-
MOCK_METHOD((std::unique_ptr<Catalog::TableBuilder>), BuildTable,
81+
MOCK_METHOD((std::unique_ptr<TableBuilder>), BuildTable,
8282
(const TableIdentifier&, const Schema&), (const, override));
8383
};
8484

0 commit comments

Comments
 (0)