File tree 1 file changed +8
-0
lines changed 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -400,6 +400,10 @@ impl<'a> ImportedArrowArray<'a> {
400
400
( length + 1 ) * ( bits / 8 )
401
401
}
402
402
( DataType :: Utf8 , 2 ) | ( DataType :: Binary , 2 ) => {
403
+ if self . array . is_empty ( ) {
404
+ return Ok ( 0 ) ;
405
+ }
406
+
403
407
// the len of the data buffer (buffer 2) equals the last value of the offset buffer (buffer 1)
404
408
let len = self . buffer_len ( 1 , dt) ?;
405
409
// first buffer is the null buffer => add(1)
@@ -410,6 +414,10 @@ impl<'a> ImportedArrowArray<'a> {
410
414
( unsafe { * offset_buffer. add ( len / size_of :: < i32 > ( ) - 1 ) } ) as usize
411
415
}
412
416
( DataType :: LargeUtf8 , 2 ) | ( DataType :: LargeBinary , 2 ) => {
417
+ if self . array . is_empty ( ) {
418
+ return Ok ( 0 ) ;
419
+ }
420
+
413
421
// the len of the data buffer (buffer 2) equals the last value of the offset buffer (buffer 1)
414
422
let len = self . buffer_len ( 1 , dt) ?;
415
423
// first buffer is the null buffer => add(1)
You can’t perform that action at this time.
0 commit comments