kamcheungting-db opened a new pull request, #3397:
URL: https://github.com/apache/iceberg-rust/pull/3397

   ## Which issue does this PR close?
   
   Related to #1102. Implements the pure type/key helpers for milestone 2 of 
#3305. This PR is independent of the row model in #3335.
   
   ## What changes are included in this PR?
   
   Partition statistics need to retain historical fields after their source 
columns are dropped and recover partition keys from imported files by field ID. 
Add an internal historical partition resolver and reusable per-spec mapping 
plans for these operations.
   
   - Build the full optional field union in partition-field-ID order, with the 
newest names and types recovered from supplied current/retained schemas or 
physical manifest partition types.
   - Reconcile int-to-long, float-to-double, and decimal precision promotions 
at a fixed scale. Preserve historical non-void types through v1 void 
replacement, provide the void-only fallback, and reject incompatible field 
definitions or type evidence.
   - Recover canonical keys in original spec order from reordered physical 
layouts, keeping spec IDs distinct. Reject physically missing necessary fields 
while preserving present nulls; omitted void fields are recoverable because 
their values are always null.
   - Project canonical keys into the unified output layout and validate value 
types, tuple lengths, decimal precision, and fixed binary lengths. Preserve 
signed-zero distinctions and normalized NaN equality when promoting 
floating-point keys.
   
   The helpers remain internal and accept injected evidence without storage 
access. Physical manifest writer-schema extraction is assigned to milestone 5, 
before full computation integrates that fallback. The existing active-field 
projection and writer partition keys retain their behavior.
   
   ## Are these changes tested?
   
   Added 23 synchronous unit tests covering historical schema recovery, 
evolution, promotions, mapping round trips, missing fields versus nulls, void 
behavior, distinct specs, floating-point identity, and invalid evidence/values.
   
   Passed:
   
   ```sh
   cargo test --offline --locked -p iceberg --lib partitioning
   cargo clippy --offline --locked -p iceberg --lib --tests --all-features -- 
-D warnings
   cargo fmt --all -- --check
   git diff --cached --check
   ```
   
   The focused filter ran 44 tests, including existing partitioning, Arrow, and 
writer tests. The public API regenerated with the repository-pinned 
`[email protected]` exactly matches the existing snapshot. The full 
workspace suite was not run.
   
   ## AI Disclosure
   
   Developed with assistance from OpenAI Codex.
   


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