Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/iceberg/json_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ 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));
ICEBERG_ASSIGN_OR_RAISE(auto field, PartitionFieldFromJson(entry_json, true));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

( can we use something like code below?)

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
Expand Down
Loading