wzx140 opened a new pull request, #8051: URL: https://github.com/apache/paimon/pull/8051
### Purpose `firstRowIdToPartitionMap` is used by data evolution MERGE INTO writes to locate the original partition and row count for each data file from its `firstRowId`. This mapping is built from scanned `DataSplit`s and then used by each Spark task while writing evolved rows. For merge plans that affect many files across many partitions, the map can become large. Capturing it directly in every task closure duplicates the serialized map for each task and can make Spark task serialization very large. ### Solution Broadcast `firstRowIdToPartitionMap` once through Spark instead of embedding the whole map in every task closure. The map stores partition `BinaryRow`s as serialized bytes. `BinaryRow` keeps its memory segments in transient fields and relies on Java serialization hooks to restore them, while Spark Kryo may serialize the object fields directly. Serializing the partition with `SerializationUtils.serializeBinaryRow` keeps the broadcast value Kryo-safe, and the writer deserializes the bytes before use. -- 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]
