kuldeep27396 opened a new pull request, #15625: URL: https://github.com/apache/iceberg/pull/15625
## Why this change Resolves #15622 **Problem**: BaseFile.splitOffsets() was creating a new List wrapper on every invocation via ArrayUtil.toUnmodifiableLongList(). When file metadata is read and rewritten (e.g., during manifest rewriting or format conversion), each entry needlessly allocates a list that is immediately consumed and discarded. **Solution**: Cache the List representation after the first conversion, similar to how other fields like partitionData are handled. The cache is transient so it won't be serialized. ## Changes - Added private transient List splitOffsetsList field to cache the converted list - Modified splitOffsets() to return the cached list instead of creating a new one on each call - The cached list is created lazily on first access ## Performance Impact This eliminates unnecessary object allocations when: - Reading and rewriting manifest files - Format conversions - Any scenario where splitOffsets() is called multiple times on the same BaseFile instance The change is minimal and focused, following the existing pattern used for other cached fields in the class. -- 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]
