mapleFU commented on code in PR #121: URL: https://github.com/apache/iceberg-cpp/pull/121#discussion_r2139352798
########## src/iceberg/json_internal.cc: ########## @@ -1053,14 +1052,10 @@ Status ParsePartitionSpecs(const nlohmann::json& json, int8_t format_version, int32_t next_partition_field_id = PartitionSpec::kLegacyPartitionDataIdStart; std::vector<PartitionField> fields; for (const auto& entry_json : partition_spec_json) { - ICEBERG_ASSIGN_OR_RAISE(auto field, PartitionFieldFromJson(entry_json)); - 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 - field_id = next_partition_field_id++; - } - fields.emplace_back(field->source_id(), field_id, std::string(field->name()), - std::move(field->transform())); + ICEBERG_ASSIGN_OR_RAISE( + auto field, PartitionFieldFromJson(entry_json, next_partition_field_id)); + next_partition_field_id++; Review Comment: ++next_partition_field_id; -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org