nssalian opened a new pull request, #17114:
URL: https://github.com/apache/iceberg/pull/17114

   ## Changes
   
   Precomputes a sorted `Entry[]` once in the `SerializationState` constructor. 
   `writeTo` becomes an index loop over the array.
   
   Per-writeTo, this removes:
   - `SortedMerge.of(...)` + two `stream().sorted()` iterators
   - 2N HashMap lookups (`shreddedFields.get` + `unshreddedFields.get`)
   - The `Maps.newHashMap(shredded)` defensive copy
   
   The `Maps.newHashMap(shredded)` copy was there to stop the old code from 
accidentally 
   modifying the caller's map (#15087). The refactor never modifies the 
caller's map, so the copy is no longer needed.
   
   Output bytes are unchanged.
   
   ## Tests
   
   Three new tests in `TestShreddedObject`:
   - `testPutAfterRemoveIsSerialized` - `remove(x)` then `put(x, v)` semantics
   - `testEmptyObject` - zero-field state
   - `testRepeatedWriteToProducesSameBytes` - cached-state reuse across writes


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