Commit e19e982 1 parent 4e278ca commit e19e982 Copy full SHA for e19e982
File tree 1 file changed +5
-3
lines changed
datafusion/physical-plan/src
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -492,8 +492,10 @@ fn gc_string_view_batch(batch: &RecordBatch) -> RecordBatch {
492
492
if actual_buffer_size > ( ideal_buffer_size * 2 ) {
493
493
// We set the block size to `ideal_buffer_size` so that the new StringViewArray only has one buffer, which accelerate later concat_batches.
494
494
// See https://github.com/apache/arrow-rs/issues/6094 for more details.
495
- let mut builder = StringViewBuilder :: with_capacity ( s. len ( ) )
496
- . with_block_size ( ideal_buffer_size as u32 ) ;
495
+ let mut builder = StringViewBuilder :: with_capacity ( s. len ( ) ) ;
496
+ if ideal_buffer_size > 0 {
497
+ builder = builder. with_block_size ( ideal_buffer_size as u32 ) ;
498
+ }
497
499
498
500
for v in s. iter ( ) {
499
501
builder. append_option ( v) ;
@@ -802,7 +804,7 @@ mod tests {
802
804
impl StringViewTest {
803
805
/// Create a `StringViewArray` with the parameters specified in this struct
804
806
fn build ( self ) -> StringViewArray {
805
- let mut builder = StringViewBuilder :: with_capacity ( 100 ) ;
807
+ let mut builder = StringViewBuilder :: with_capacity ( 100 ) . with_block_size ( 8192 ) ;
806
808
loop {
807
809
for & v in self . strings . iter ( ) {
808
810
builder. append_option ( v) ;
You can’t perform that action at this time.
0 commit comments