etseidl opened a new issue, #9734: URL: https://github.com/apache/arrow-rs/issues/9734
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.** While reviewing #9653 I had a hard time understanding the transition from bit-packed runs to RLE runs, largely due to a confusing use of `flush_bit_packed_run` and some misleading comments. The current `flush_bit_packed_run` actually serves two purpose. The first is to flush a batch of buffered values as a bit-packed run, the second is to end a bit-packed run by writing the number of 8-element groups that have been written to the beginning of the run. When transitioning from bit-packed to RLE mode, `flush_buffered_values` first sets the number of buffered values to 0, and then conditionally calls `flush_bit_packed_run(true)`. By setting the number of buffered values to 0, `flush_bit_packed_run` writes no actual data, so the entire purpose of the call is to write the number of groups. **Describe the solution you'd like** I'd like to split `flush_bit_packed_run` into two functions: `flush_bit_packed_run` to actually write data, and `finish_bit_packed_run` to write the number of groups. This allows calling `finish_bit_packed_run` directly from `flush_buffered_values` making the intent clearer. **Describe alternatives you've considered** <!-- A clear and concise description of any alternative solutions or features you've considered. --> **Additional context** <!-- Add any other context or screenshots about the feature request here. --> -- 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]
