1919
2020use crate :: filter:: { FilterBuilder , FilterPredicate , SlicesIterator } ;
2121use 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 } ;
2424use arrow_schema:: { ArrowError , DataType , SchemaRef } ;
2525use std:: borrow:: Cow ;
2626use 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