Skip to content

Commit dfe907f

Browse files
authored
Minor: Support BinaryView and StringView builders in make_builder (apache#7931)
# Which issue does this PR close? - Closes #NNN. This is minor but I can create an issue if needed. # Rationale for this change `make_builder` currently errors with `Data type Utf8View is not currently supported`. # What changes are included in this PR? Support `DataType::Utf8View` and `DataType::BinaryView` in `make_builder`. # Are these changes tested? Only via the exhaustive enum match. It doesn't look like there are any tests for `make_builder` in that file? # Are there any user-facing changes? No
1 parent 7089786 commit dfe907f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arrow-array/src/builder/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ pub fn make_builder(datatype: &DataType, capacity: usize) -> Box<dyn ArrayBuilde
447447
DataType::Float64 => Box::new(Float64Builder::with_capacity(capacity)),
448448
DataType::Binary => Box::new(BinaryBuilder::with_capacity(capacity, 1024)),
449449
DataType::LargeBinary => Box::new(LargeBinaryBuilder::with_capacity(capacity, 1024)),
450+
DataType::BinaryView => Box::new(BinaryViewBuilder::with_capacity(capacity)),
450451
DataType::FixedSizeBinary(len) => {
451452
Box::new(FixedSizeBinaryBuilder::with_capacity(capacity, *len))
452453
}
@@ -464,6 +465,7 @@ pub fn make_builder(datatype: &DataType, capacity: usize) -> Box<dyn ArrayBuilde
464465
),
465466
DataType::Utf8 => Box::new(StringBuilder::with_capacity(capacity, 1024)),
466467
DataType::LargeUtf8 => Box::new(LargeStringBuilder::with_capacity(capacity, 1024)),
468+
DataType::Utf8View => Box::new(StringViewBuilder::with_capacity(capacity)),
467469
DataType::Date32 => Box::new(Date32Builder::with_capacity(capacity)),
468470
DataType::Date64 => Box::new(Date64Builder::with_capacity(capacity)),
469471
DataType::Time32(TimeUnit::Second) => {

0 commit comments

Comments
 (0)