From 2388e1562d4cd9faa15aedd00c89d1b8da14a47f Mon Sep 17 00:00:00 2001 From: Xinli Shang Date: Sun, 28 Dec 2025 12:14:31 -0800 Subject: [PATCH 1/2] refactor: remove obsolete format string workaround Remove workaround for old Clang/libc++ bug where "<{}>" in format strings was incorrectly parsed. Modern compilers handle this correctly. Changes: - Simplify ListType::ToString() to use direct format string - Simplify MapType::ToString() to use direct format string - Remove XXX comments about the workaround The existing tests will verify this works correctly on current compilers. --- src/iceberg/type.cc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/iceberg/type.cc b/src/iceberg/type.cc index 44512c0d3..b3fe3c2d8 100644 --- a/src/iceberg/type.cc +++ b/src/iceberg/type.cc @@ -151,12 +151,7 @@ ListType::ListType(int32_t field_id, std::shared_ptr type, bool optional) TypeId ListType::type_id() const { return kTypeId; } std::string ListType::ToString() const { - // XXX: work around Clang/libc++: "<{}>" in a format string appears to get - // parsed as {<>} or something; split up the format string to avoid that - std::string repr = "list<"; - std::format_to(std::back_inserter(repr), "{}", element_); - repr += ">"; - return repr; + return std::format("list<{}>", element_); } std::span ListType::fields() const { return {&element_, 1}; } @@ -213,13 +208,7 @@ const SchemaField& MapType::value() const { return fields_[1]; } TypeId MapType::type_id() const { return kTypeId; } std::string MapType::ToString() const { - // XXX: work around Clang/libc++: "<{}>" in a format string appears to get - // parsed as {<>} or something; split up the format string to avoid that - std::string repr = "map<"; - - std::format_to(std::back_inserter(repr), "{}: {}", key(), value()); - repr += ">"; - return repr; + return std::format("map<{}: {}>", key(), value()); } std::span MapType::fields() const { return fields_; } From 048410b3335df74abae953261f76845db8eed840 Mon Sep 17 00:00:00 2001 From: Xinli Shang Date: Sun, 28 Dec 2025 14:04:17 -0800 Subject: [PATCH 2/2] style: apply clang-format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/iceberg/type.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/iceberg/type.cc b/src/iceberg/type.cc index b3fe3c2d8..99b3433b3 100644 --- a/src/iceberg/type.cc +++ b/src/iceberg/type.cc @@ -150,9 +150,7 @@ ListType::ListType(int32_t field_id, std::shared_ptr type, bool optional) : element_(field_id, std::string(kElementName), std::move(type), optional) {} TypeId ListType::type_id() const { return kTypeId; } -std::string ListType::ToString() const { - return std::format("list<{}>", element_); -} +std::string ListType::ToString() const { return std::format("list<{}>", element_); } std::span ListType::fields() const { return {&element_, 1}; } Result> ListType::GetFieldById(