ahlag opened a new pull request, #3484:
URL: https://github.com/apache/iceberg-rust/pull/3484

   ## Which issue does this PR close?
   
   - Closes #3469.
   
   ## What changes are included in this PR?
   
   `RestCatalog::create_table` now sends `spec-id: 0` when the 
`UnboundPartitionSpec` has no spec id, and keeps the id when one is set. Since 
#2610 an unset id is omitted, and servers that parse the request with Iceberg 
Java's `PartitionSpecParser` (e.g. Polaris) reject it with HTTP 400. 0 is the 
initial spec id, and is what the Java client sends for a new table.
   
   The default is applied where the request is built rather than in the serde 
attributes of `UnboundPartitionSpec`, which is also serialized for 
`TableUpdate::AddSpec` (#2702 discussed moving the skip out of the core type).
   
   ## Are these changes tested?
   
   Yes, `test_create_table` now matches the request body for `"partition-spec": 
{"spec-id": 0}`. It fails without the fix.
   
   ## AI Disclosure
   
   I used Claude Code to find the cause and write the fix and test. I reviewed 
the change and checked that the test fails without the fix. Points to check: 
whether 0 is the right default (Java servers assign a fresh spec id on create, 
so I believe the value is not used), and whether the literal 0 is fine here 
since `DEFAULT_PARTITION_SPEC_ID` is `pub(crate)` in `iceberg`.
   


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