mattfaltyn opened a new pull request, #1794:
URL: https://github.com/apache/iceberg-go/pull/1794

   ## Summary
   
   - preserve historical source-less `void` partition tombstones when binding a 
partition spec to a schema
   - keep those tombstones source-less when marshaling JSON, so accepted 
metadata round-trips without inventing `source-id: 0`
   - route partition-spec updates through the shared binding path and cover 
both direct binding and table evolution with regressions
   
   ## Problem
   
   `PartitionField.UnmarshalJSON` intentionally accepts historical `void` 
fields that omit both `source-id` and `source-ids`, representing them 
internally with the compatibility sentinel `[]int{0}`. 
`PartitionSpec.BindToSchema` and `UpdateSpec.Apply` then treated that sentinel 
as a real schema field ID and failed with `field id 0 not found`, preventing 
otherwise valid metadata from being rebound or evolved.
   
   The fix recognizes only the exact source-less `void` sentinel, preserves it 
without a schema lookup, and continues to validate every sourced partition 
field through the existing path. JSON marshaling omits the synthetic sentinel 
so the accepted historical representation remains round-trippable.
   
   Fixes #1791
   
   ## Testing
   
   - `go test . ./table -run 
'TestBindToSchemaPreservesSourceLessVoidTombstone|TestUpdateSpecPreservesSourceLessVoidTombstone'
 -count=2 -v`
   - `go test ./... -count=1`
   - `go test -race -v ./codec/... ./table/... -count=1`
   - `golangci-lint run --timeout=10m --verbose` (v2.11.4, 0 issues)
   - `go vet ./...`
   - `GOOS=linux GOARCH=s390x CGO_ENABLED=0 go build ./...`
   - `dev/check-license`
   - `git diff --check origin/main...HEAD`
   


-- 
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]

Reply via email to