Skip to content

Commit ffb8f44

Browse files
committed
temp: only use incremental builder for stringview
1 parent a6f6e58 commit ffb8f44

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

arrow-select/src/incremental_batch_builder.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
2020
use crate::filter::{FilterBuilder, FilterPredicate, SlicesIterator};
2121
use crate::incremental_array_builder::{GenericIncrementalArrayBuilder, IncrementalArrayBuilder};
22-
use arrow_array::builder::{BinaryViewBuilder, PrimitiveBuilder, StringViewBuilder};
23-
use arrow_array::{downcast_primitive, BooleanArray, RecordBatch};
22+
use arrow_array::builder::{BinaryViewBuilder, StringViewBuilder};
23+
use arrow_array::{BooleanArray, RecordBatch};
2424
use arrow_schema::{ArrowError, DataType, SchemaRef};
2525
use std::borrow::Cow;
2626
use std::collections::VecDeque;
@@ -309,7 +309,7 @@ fn get_filter_limit(filter: &BooleanArray, row_limit: usize) -> FilterLimit {
309309
}
310310
}
311311
}
312-
312+
/*
313313
/// Create an incremental array builder for the given data type
314314
///
315315
/// Uses a generic implementation if we don't have a specific builder for the type
@@ -331,3 +331,21 @@ fn instantiate_builder(data_type: &DataType, batch_size: usize) -> ArrayBuilderI
331331
_ => Box::new(GenericIncrementalArrayBuilder::new()),
332332
}
333333
}
334+
*/
335+
336+
/// Create an incremental array builder for the given data type
337+
///
338+
/// Uses a generic implementation if we don't have a specific builder for the type
339+
///
340+
/// TEMPORARY test: only use string view builder for now to test
341+
/// with https://github.com/apache/datafusion/pull/16208
342+
fn instantiate_builder(data_type: &DataType, batch_size: usize) -> ArrayBuilderImpl {
343+
match data_type {
344+
DataType::Utf8View => Box::new(StringViewBuilder::with_capacity(batch_size)),
345+
DataType::BinaryView => Box::new(BinaryViewBuilder::with_capacity(batch_size)),
346+
347+
// Default to using the generic builder for all other types
348+
//
349+
_ => Box::new(GenericIncrementalArrayBuilder::new()),
350+
}
351+
}

0 commit comments

Comments
 (0)