@@ -21,8 +21,6 @@ mod cache;
2121mod consts;
2222mod struct_builder;
2323
24- use arrow:: buffer:: MutableBuffer ;
25- use arrow:: buffer:: NullBuffer ;
2624use std:: borrow:: Borrow ;
2725use std:: cmp:: Ordering ;
2826use std:: collections:: { HashSet , VecDeque } ;
@@ -62,15 +60,15 @@ use arrow::array::{
6260 Date64Array , Decimal128Array , Decimal256Array , Decimal32Array , Decimal64Array ,
6361 DictionaryArray , DurationMicrosecondArray , DurationMillisecondArray ,
6462 DurationNanosecondArray , DurationSecondArray , FixedSizeBinaryArray ,
65- FixedSizeListArray , Float16Array , Float32Array , Float64Array , GenericListArray ,
66- Int16Array , Int32Array , Int64Array , Int8Array , IntervalDayTimeArray ,
67- IntervalMonthDayNanoArray , IntervalYearMonthArray , LargeBinaryArray , LargeListArray ,
68- LargeStringArray , ListArray , MapArray , MutableArrayData , OffsetSizeTrait ,
69- PrimitiveArray , Scalar , StringArray , StringViewArray , StructArray ,
70- Time32MillisecondArray , Time32SecondArray , Time64MicrosecondArray ,
71- Time64NanosecondArray , TimestampMicrosecondArray , TimestampMillisecondArray ,
72- TimestampNanosecondArray , TimestampSecondArray , UInt16Array , UInt32Array ,
73- UInt64Array , UInt8Array , UnionArray ,
63+ FixedSizeBinaryBuilder , FixedSizeListArray , Float16Array , Float32Array , Float64Array ,
64+ GenericListArray , Int16Array , Int32Array , Int64Array , Int8Array ,
65+ IntervalDayTimeArray , IntervalMonthDayNanoArray , IntervalYearMonthArray ,
66+ LargeBinaryArray , LargeListArray , LargeStringArray , ListArray , MapArray ,
67+ MutableArrayData , OffsetSizeTrait , PrimitiveArray , Scalar , StringArray ,
68+ StringViewArray , StructArray , Time32MillisecondArray , Time32SecondArray ,
69+ Time64MicrosecondArray , Time64NanosecondArray , TimestampMicrosecondArray ,
70+ TimestampMillisecondArray , TimestampNanosecondArray , TimestampSecondArray ,
71+ UInt16Array , UInt32Array , UInt64Array , UInt8Array , UnionArray ,
7472} ;
7573use arrow:: buffer:: { BooleanBuffer , ScalarBuffer } ;
7674use arrow:: compute:: kernels:: cast:: { cast_with_options, CastOptions } ;
@@ -2995,14 +2993,9 @@ impl ScalarValue {
29952993 // TODO: Replace with FixedSizeBinaryArray::new_null once a fix for
29962994 // https://github.com/apache/arrow-rs/issues/8900 is in the used arrow-rs
29972995 // version.
2998- let capacity_in_bytes =
2999- s. to_usize ( ) . unwrap ( ) . checked_mul ( size) . unwrap ( ) ;
3000- Arc :: new ( FixedSizeBinaryArray :: try_new (
3001- * s,
3002- // MutableBuffer::new_null is in bits.
3003- MutableBuffer :: new_null ( capacity_in_bytes * 8 ) . into ( ) ,
3004- Some ( NullBuffer :: new_null ( size) ) ,
3005- ) ?)
2996+ let mut builder = FixedSizeBinaryBuilder :: new ( * s) ;
2997+ builder. append_nulls ( size) ;
2998+ Arc :: new ( builder. finish ( ) )
30062999 }
30073000 } ,
30083001 ScalarValue :: LargeBinary ( e) => match e {
0 commit comments