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
Additional context
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_runand some misleading comments.The current
flush_bit_packed_runactually 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_valuesfirst sets the number of buffered values to 0, and then conditionally callsflush_bit_packed_run(true). By setting the number of buffered values to 0,flush_bit_packed_runwrites 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_runinto two functions:flush_bit_packed_runto actually write data, andfinish_bit_packed_runto write the number of groups. This allows callingfinish_bit_packed_rundirectly fromflush_buffered_valuesmaking the intent clearer.Describe alternatives you've considered
Additional context