LuciferYang opened a new pull request, #13723:
URL: https://github.com/apache/gluten/pull/13723

   ## What changes are proposed in this pull request?
   
   `framedSerializeV3Impl` now gives `serializeSingleColumn` an `std::ostream` 
whose streambuf appends to the frame vector, and fills in each column's 4-byte 
length after the column is written. Before, each column went through an 
`ostringstream`, a `std::string` and a `std::vector<uint8_t>` before it was 
copied into the frame. The frame bytes don't change.
   
   The streambuf can't seek. `serializeSingleColumn` doesn't need it to: 
`VectorStream::flush` only calls `write` on the output.
   
   The same copy path is in v1.8.0-rc1. This is a performance change, so it 
doesn't need to block 1.8.0.
   
   Fixes #13722.
   
   ## How was this patch tested?
   
   Added `framedSerializeV3ComplexTypesRoundTrip` to 
`VeloxColumnarBatchSerializerTest`. It serializes 5000 rows of bigint, long 
string, array, map and struct columns with nulls, with and without stats, and 
decodes every column. The existing V3 writer tests use 5 rows of flat columns.
   
   Not covered by CI:
   
   - The frame bytes are unchanged: the SHA-256 of each of the 60 cached 
batches of a 12-column table (nested types included, stats on and off) is the 
same before and after.
   - On macOS arm64 with a release build, `framedSerializeV3` on a 1M-row, 
8-column batch (66 MB frame) takes 19.8 ms instead of 29.0 ms (median of 15 
calls). `df.cache().count()` on 20M rows and 8 columns takes 1365 ms instead of 
1510 ms (median of 7 runs).
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus
   


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