Skip to content

Commit 2eab0b8

Browse files
authored
fix: allow PartitionField's field_id to be missing in Iceberg v1 (#121)
Just looks like forget to use `allow_field_id_missing` in `PartitionFieldFromJson(const nlohmann::json& json, bool allow_field_id_missing)` In v1 iceberg, we should allow field_id is missing. --------- Signed-off-by: Smith Cruise <[email protected]>
1 parent db8aa74 commit 2eab0b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/iceberg/json_internal.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,9 @@ Status ParsePartitionSpecs(const nlohmann::json& json, int8_t format_version,
10561056
int32_t next_partition_field_id = PartitionSpec::kLegacyPartitionDataIdStart;
10571057
std::vector<PartitionField> fields;
10581058
for (const auto& entry_json : partition_spec_json) {
1059-
ICEBERG_ASSIGN_OR_RAISE(auto field, PartitionFieldFromJson(entry_json));
1059+
ICEBERG_ASSIGN_OR_RAISE(
1060+
auto field, PartitionFieldFromJson(
1061+
entry_json, /*allow_field_id_missing=*/format_version == 1));
10601062
int32_t field_id = field->field_id();
10611063
if (field_id == SchemaField::kInvalidFieldId) {
10621064
// If the field ID is not set, we need to assign a new one

0 commit comments

Comments
 (0)