From fa7bed99424740e3fff7443539e196f400af7f19 Mon Sep 17 00:00:00 2001 From: HeartLinked Date: Wed, 6 Aug 2025 17:12:31 +0800 Subject: [PATCH 1/4] style: Improve BuildTable signature readability --- src/iceberg/catalog.h | 18 +++++++++--------- src/iceberg/catalog/in_memory_catalog.cc | 2 +- src/iceberg/catalog/in_memory_catalog.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/iceberg/catalog.h b/src/iceberg/catalog.h index 1f3373577..8bd850b26 100644 --- a/src/iceberg/catalog.h +++ b/src/iceberg/catalog.h @@ -176,15 +176,6 @@ class ICEBERG_EXPORT Catalog { virtual Result> 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 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: @@ -233,6 +224,15 @@ class ICEBERG_EXPORT Catalog { /// \return the Transaction to create the table virtual std::unique_ptr 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 BuildTable( + const TableIdentifier& identifier, const Schema& schema) const = 0; }; } // namespace iceberg diff --git a/src/iceberg/catalog/in_memory_catalog.cc b/src/iceberg/catalog/in_memory_catalog.cc index af6aa146f..6384b41f2 100644 --- a/src/iceberg/catalog/in_memory_catalog.cc +++ b/src/iceberg/catalog/in_memory_catalog.cc @@ -441,7 +441,7 @@ Result> InMemoryCatalog::RegisterTable( return LoadTable(identifier); } -std::unique_ptr InMemoryCatalog::BuildTable( +std::unique_ptr InMemoryCatalog::BuildTable( const TableIdentifier& identifier, const Schema& schema) const { throw IcebergError("not implemented"); } diff --git a/src/iceberg/catalog/in_memory_catalog.h b/src/iceberg/catalog/in_memory_catalog.h index e3da403e5..109e4bc14 100644 --- a/src/iceberg/catalog/in_memory_catalog.h +++ b/src/iceberg/catalog/in_memory_catalog.h @@ -90,8 +90,8 @@ class ICEBERG_EXPORT InMemoryCatalog const TableIdentifier& identifier, const std::string& metadata_file_location) override; - std::unique_ptr BuildTable(const TableIdentifier& identifier, - const Schema& schema) const override; + std::unique_ptr BuildTable( + const TableIdentifier& identifier, const Schema& schema) const override; private: std::string catalog_name_; From cb283e8b1a822a3e6c668a473996e5bf4648335c Mon Sep 17 00:00:00 2001 From: Li Feiyang Date: Thu, 7 Aug 2025 10:54:45 +0800 Subject: [PATCH 2/4] Update src/iceberg/catalog/in_memory_catalog.cc Co-authored-by: Gang Wu --- src/iceberg/catalog/in_memory_catalog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iceberg/catalog/in_memory_catalog.cc b/src/iceberg/catalog/in_memory_catalog.cc index 6384b41f2..6c34d3adf 100644 --- a/src/iceberg/catalog/in_memory_catalog.cc +++ b/src/iceberg/catalog/in_memory_catalog.cc @@ -441,7 +441,7 @@ Result> InMemoryCatalog::RegisterTable( return LoadTable(identifier); } -std::unique_ptr InMemoryCatalog::BuildTable( +std::unique_ptr InMemoryCatalog::BuildTable( const TableIdentifier& identifier, const Schema& schema) const { throw IcebergError("not implemented"); } From 0dfb013da815f8b98fae6aa6fb52a1135ce398fe Mon Sep 17 00:00:00 2001 From: Li Feiyang Date: Thu, 7 Aug 2025 10:55:04 +0800 Subject: [PATCH 3/4] Update src/iceberg/catalog/in_memory_catalog.h Co-authored-by: Gang Wu --- src/iceberg/catalog/in_memory_catalog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iceberg/catalog/in_memory_catalog.h b/src/iceberg/catalog/in_memory_catalog.h index 109e4bc14..f15110448 100644 --- a/src/iceberg/catalog/in_memory_catalog.h +++ b/src/iceberg/catalog/in_memory_catalog.h @@ -90,7 +90,7 @@ class ICEBERG_EXPORT InMemoryCatalog const TableIdentifier& identifier, const std::string& metadata_file_location) override; - std::unique_ptr BuildTable( + std::unique_ptr BuildTable( const TableIdentifier& identifier, const Schema& schema) const override; private: From 0f7bcaddcb92bcea26bdf5bb3528dd0544b78a6c Mon Sep 17 00:00:00 2001 From: Li Feiyang Date: Thu, 7 Aug 2025 10:55:23 +0800 Subject: [PATCH 4/4] Update src/iceberg/catalog.h Co-authored-by: Gang Wu --- src/iceberg/catalog.h | 4 ++-- src/iceberg/catalog/in_memory_catalog.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/iceberg/catalog.h b/src/iceberg/catalog.h index 8bd850b26..03bd0f6c4 100644 --- a/src/iceberg/catalog.h +++ b/src/iceberg/catalog.h @@ -231,8 +231,8 @@ class ICEBERG_EXPORT Catalog { /// \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 BuildTable( - const TableIdentifier& identifier, const Schema& schema) const = 0; + virtual std::unique_ptr BuildTable(const TableIdentifier& identifier, + const Schema& schema) const = 0; }; } // namespace iceberg diff --git a/src/iceberg/catalog/in_memory_catalog.h b/src/iceberg/catalog/in_memory_catalog.h index f15110448..979c784de 100644 --- a/src/iceberg/catalog/in_memory_catalog.h +++ b/src/iceberg/catalog/in_memory_catalog.h @@ -90,8 +90,8 @@ class ICEBERG_EXPORT InMemoryCatalog const TableIdentifier& identifier, const std::string& metadata_file_location) override; - std::unique_ptr BuildTable( - const TableIdentifier& identifier, const Schema& schema) const override; + std::unique_ptr BuildTable(const TableIdentifier& identifier, + const Schema& schema) const override; private: std::string catalog_name_;