From d1712a3bb9e541639f14ff5e8b64142c392bf904 Mon Sep 17 00:00:00 2001 From: Smith Cruise Date: Tue, 10 Jun 2025 09:48:16 +0000 Subject: [PATCH 1/2] fix bug Signed-off-by: Smith Cruise --- src/iceberg/json_internal.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iceberg/json_internal.cc b/src/iceberg/json_internal.cc index 3614ed230..904253dac 100644 --- a/src/iceberg/json_internal.cc +++ b/src/iceberg/json_internal.cc @@ -1053,7 +1053,7 @@ Status ParsePartitionSpecs(const nlohmann::json& json, int8_t format_version, int32_t next_partition_field_id = PartitionSpec::kLegacyPartitionDataIdStart; std::vector fields; for (const auto& entry_json : partition_spec_json) { - ICEBERG_ASSIGN_OR_RAISE(auto field, PartitionFieldFromJson(entry_json)); + ICEBERG_ASSIGN_OR_RAISE(auto field, PartitionFieldFromJson(entry_json, true)); int32_t field_id = field->field_id(); if (field_id == SchemaField::kInvalidFieldId) { // If the field ID is not set, we need to assign a new one From fc9ee8ab9274fcf5ed2d149ec43b9ce018188851 Mon Sep 17 00:00:00 2001 From: Smith Cruise Date: Sat, 14 Jun 2025 20:34:05 +0800 Subject: [PATCH 2/2] use original code Signed-off-by: Smith Cruise --- src/iceberg/json_internal.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/iceberg/json_internal.cc b/src/iceberg/json_internal.cc index 904253dac..b6c26bd1b 100644 --- a/src/iceberg/json_internal.cc +++ b/src/iceberg/json_internal.cc @@ -1053,7 +1053,9 @@ Status ParsePartitionSpecs(const nlohmann::json& json, int8_t format_version, int32_t next_partition_field_id = PartitionSpec::kLegacyPartitionDataIdStart; std::vector fields; for (const auto& entry_json : partition_spec_json) { - ICEBERG_ASSIGN_OR_RAISE(auto field, PartitionFieldFromJson(entry_json, true)); + ICEBERG_ASSIGN_OR_RAISE( + auto field, PartitionFieldFromJson( + entry_json, /*allow_field_id_missing=*/format_version == 1)); int32_t field_id = field->field_id(); if (field_id == SchemaField::kInvalidFieldId) { // If the field ID is not set, we need to assign a new one