Skip to content

Commit 1eb49d7

Browse files
committed
fix build failure
1 parent e9dfeef commit 1eb49d7

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/iceberg/test/update_schema_test.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,8 @@ TEST_F(UpdateSchemaTest, TestMultipleMoves) {
14781478
EXPECT_EQ(fields[0].name(), "z");
14791479
EXPECT_EQ(fields[1].name(), "y");
14801480

1481-
int w_pos = -1, x_pos = -1;
1481+
int w_pos = -1;
1482+
int x_pos = -1;
14821483
for (size_t i = 0; i < fields.size(); ++i) {
14831484
if (fields[i].name() == "w") w_pos = i;
14841485
if (fields[i].name() == "x") x_pos = i;
@@ -1507,7 +1508,8 @@ TEST_F(UpdateSchemaTest, TestMoveTopLevelColumnBeforeFirst) {
15071508
ASSERT_TRUE(result.schema != nullptr);
15081509

15091510
const auto& fields = result.schema->fields();
1510-
int y_pos = -1, x_pos = -1;
1511+
int y_pos = -1;
1512+
int x_pos = -1;
15111513
for (size_t i = 0; i < fields.size(); ++i) {
15121514
if (fields[i].name() == "y") y_pos = i;
15131515
if (fields[i].name() == "x") x_pos = i;
@@ -1541,7 +1543,8 @@ TEST_F(UpdateSchemaTest, TestMoveTopLevelColumnAfter) {
15411543
ASSERT_TRUE(result.schema != nullptr);
15421544

15431545
const auto& fields = result.schema->fields();
1544-
int w_pos = -1, x_pos = -1;
1546+
int w_pos = -1;
1547+
int x_pos = -1;
15451548
for (size_t i = 0; i < fields.size(); ++i) {
15461549
if (fields[i].name() == "w") w_pos = i;
15471550
if (fields[i].name() == "x") x_pos = i;

src/iceberg/type.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ TypeId ListType::type_id() const { return kTypeId; }
156156
const SchemaField& ListType::element() const { return element_; }
157157

158158
std::string ListType::ToString() const {
159-
return std::format("list<{}>", element_.type()->ToString());
159+
return std::vformat("list<{}>", std::make_format_args(element_));
160160
}
161161

162162
std::span<const SchemaField> ListType::fields() const { return {&element_, 1}; }
@@ -213,7 +213,7 @@ const SchemaField& MapType::value() const { return fields_[1]; }
213213
TypeId MapType::type_id() const { return kTypeId; }
214214

215215
std::string MapType::ToString() const {
216-
return std::format("map<{}, {}>", key().type()->ToString(), value().type()->ToString());
216+
return std::vformat("map<{}: {}>", std::make_format_args(key(), value()));
217217
}
218218

219219
std::span<const SchemaField> MapType::fields() const { return fields_; }

src/iceberg/update/update_schema.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,7 @@ UpdateSchema& UpdateSchema::MoveInternal(std::string_view name, const Move& move
752752

753753
const auto& parent_field = parent_field_result.value()->get();
754754
ICEBERG_BUILDER_CHECK(parent_field.type()->type_id() == TypeId::kStruct,
755-
"Cannot move fields in non-struct type: {}",
756-
parent_field.type()->ToString());
755+
"Cannot move fields in non-struct type");
757756

758757
if (move.type == Move::MoveType::kBefore || move.type == Move::MoveType::kAfter) {
759758
auto ref_parent_it = id_to_parent_.find(move.reference_field_id);

0 commit comments

Comments
 (0)