Skip to content

Conversation

@HeartLinked
Copy link
Contributor

No description provided.

@HeartLinked HeartLinked force-pushed the feat/partition-spec-make branch 2 times, most recently from 36883b4 to f4b7f4b Compare November 13, 2025 03:54
@HeartLinked HeartLinked force-pushed the feat/partition-spec-make branch from 351ea2d to dbc3ceb Compare November 13, 2025 09:23
@HeartLinked HeartLinked changed the title feat: add PartitionSpec::Make and PartitionSpec::Validate refactor: make PartitionSpec ctor private and add factory methods with validation Nov 13, 2025
Comment on lines 550 to 551
spec, PartitionSpec::Make(*schema, spec_id, std::move(partition_fields),
true /*allow_missing_fields*/));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
spec, PartitionSpec::Make(*schema, spec_id, std::move(partition_fields),
true /*allow_missing_fields*/));
spec, PartitionSpec::Make(*schema, spec_id, std::move(partition_fields),
/*allow_missing_fields=*/false));

It is illegal for the current spec to have a missing source field. You can verify it by checking the Java code below that bind(schema) is called.

  public PartitionSpec bind(Schema schema) {
    return copyToBuilder(schema).build();
  }

  public PartitionSpec bind(Schema schema, boolean ignoreMissingFields) {
    return copyToBuilder(schema).build(ignoreMissingFields);
  }

@wgtmac wgtmac merged commit 6fe80fe into apache:main Nov 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants