@@ -64,6 +64,9 @@ pub use struct_array::*;
64
64
mod union_array;
65
65
pub use union_array:: * ;
66
66
67
+ mod run_array;
68
+ pub use run_array:: * ;
69
+
67
70
/// Trait for dealing with different types of array at runtime when the type of the
68
71
/// array is not known in advance.
69
72
pub trait Array : std:: fmt:: Debug + Send + Sync {
@@ -579,6 +582,20 @@ pub fn make_array(data: ArrayData) -> ArrayRef {
579
582
}
580
583
dt => panic ! ( "Unexpected dictionary key type {:?}" , dt) ,
581
584
} ,
585
+ DataType :: RunEndEncoded ( ref run_ends_type, _) => {
586
+ match run_ends_type. data_type ( ) {
587
+ DataType :: Int16 => {
588
+ Arc :: new ( RunArray :: < Int16Type > :: from ( data) ) as ArrayRef
589
+ }
590
+ DataType :: Int32 => {
591
+ Arc :: new ( RunArray :: < Int32Type > :: from ( data) ) as ArrayRef
592
+ }
593
+ DataType :: Int64 => {
594
+ Arc :: new ( RunArray :: < Int64Type > :: from ( data) ) as ArrayRef
595
+ }
596
+ dt => panic ! ( "Unexpected data type for run_ends array {:?}" , dt) ,
597
+ }
598
+ }
582
599
DataType :: Null => Arc :: new ( NullArray :: from ( data) ) as ArrayRef ,
583
600
DataType :: Decimal128 ( _, _) => Arc :: new ( Decimal128Array :: from ( data) ) as ArrayRef ,
584
601
DataType :: Decimal256 ( _, _) => Arc :: new ( Decimal256Array :: from ( data) ) as ArrayRef ,
@@ -737,6 +754,7 @@ pub fn new_null_array(data_type: &DataType, length: usize) -> ArrayRef {
737
754
new_null_sized_decimal ( data_type, length, std:: mem:: size_of :: < i128 > ( ) )
738
755
}
739
756
DataType :: Decimal256 ( _, _) => new_null_sized_decimal ( data_type, length, 32 ) ,
757
+ DataType :: RunEndEncoded ( _, _) => todo ! ( ) ,
740
758
}
741
759
}
742
760
0 commit comments