mattfaltyn opened a new pull request, #1988: URL: https://github.com/apache/iceberg-go/pull/1988
Closes #1987. ## Summary - normalize `last-partition-id` to the greatest assigned partition field ID during metadata preflight - preserve the unchanged-byte fast path for already-consistent metadata - cover the all-field-IDs-present case that previously allowed `UpdateSpec` to reuse a historical ID ## Why Format v2+ partition field IDs are unique across every spec in a table. When persisted metadata contained field ID `1000` but `last-partition-id` was `999`, parsing preserved the stale counter. A later distinct partition transform could then also receive ID `1000`. The preflight already computes the maximum of `999`, the persisted counter, and all explicit field IDs for legacy-ID repair. This change also writes that maximum when only the counter is stale. Valid metadata still returns the original bytes without re-marshalling. ## Testing - `go test ./table -run '^(TestParseMetadataBytesNormalizesStaleLastPartitionID|TestParseMetadataBytesAssignsMissingPartitionFieldIDs|TestUpdateSpecReuseHistoricalFieldID)$' -count=1` - `go run /private/tmp/iceberg-go-counter-repro/partition.go` (two failing-before/passing-after reproductions plus control) - `make test` - `make test-race` - `make test-assert` - `golangci-lint v2.12.2 run --timeout=10m` - `git diff --check` No documentation changes are needed because this restores the existing metadata contract without changing the public API. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
