@@ -404,7 +404,8 @@ pub fn arrow_to_column_type(arrow_type: DataType) -> Result<ColumnType, CubeErro
404404 DataType :: Utf8 | DataType :: LargeUtf8 => Ok ( ColumnType :: String ) ,
405405 DataType :: Date32 => Ok ( ColumnType :: Date ( false ) ) ,
406406 DataType :: Date64 => Ok ( ColumnType :: Date ( true ) ) ,
407- DataType :: Timestamp ( _, _) => Ok ( ColumnType :: Timestamp ) ,
407+ // build test
408+ DataType :: Timestamp ( _, _) => Ok ( ColumnType :: String ) ,
408409 DataType :: Interval ( unit) => Ok ( ColumnType :: Interval ( unit) ) ,
409410 DataType :: Float16 | DataType :: Float32 | DataType :: Float64 => Ok ( ColumnType :: Double ) ,
410411 DataType :: Boolean => Ok ( ColumnType :: Boolean ) ,
@@ -794,41 +795,4 @@ mod tests {
794795 serde_json:: to_string( & frame. data) . unwrap( )
795796 ) ;
796797 }
797-
798- #[ test]
799- fn test_arrow_to_column_type ( ) {
800- let cases = vec ! [
801- ( DataType :: Binary , ColumnType :: Blob ) ,
802- ( DataType :: Utf8 , ColumnType :: String ) ,
803- ( DataType :: LargeUtf8 , ColumnType :: String ) ,
804- ( DataType :: Date32 , ColumnType :: Date ( false ) ) ,
805- ( DataType :: Date64 , ColumnType :: Date ( true ) ) ,
806- (
807- DataType :: Timestamp ( TimeUnit :: Second , None ) ,
808- ColumnType :: Timestamp ,
809- ) ,
810- (
811- DataType :: Interval ( IntervalUnit :: YearMonth ) ,
812- ColumnType :: Interval ( IntervalUnit :: YearMonth ) ,
813- ) ,
814- ( DataType :: Float16 , ColumnType :: Double ) ,
815- ( DataType :: Float32 , ColumnType :: Double ) ,
816- ( DataType :: Float64 , ColumnType :: Double ) ,
817- ( DataType :: Boolean , ColumnType :: Boolean ) ,
818- ( DataType :: Int32 , ColumnType :: Int32 ) ,
819- ( DataType :: UInt32 , ColumnType :: Int32 ) ,
820- ( DataType :: Int8 , ColumnType :: Int64 ) ,
821- ( DataType :: Int16 , ColumnType :: Int64 ) ,
822- ( DataType :: Int64 , ColumnType :: Int64 ) ,
823- ( DataType :: UInt8 , ColumnType :: Int64 ) ,
824- ( DataType :: UInt16 , ColumnType :: Int64 ) ,
825- ( DataType :: UInt64 , ColumnType :: Int64 ) ,
826- ( DataType :: Null , ColumnType :: String ) ,
827- ] ;
828-
829- for ( arrow_type, expected_column_type) in cases {
830- let result = arrow_to_column_type ( arrow_type. clone ( ) ) . unwrap ( ) ;
831- assert_eq ! ( result, expected_column_type, "Failed for {:?}" , arrow_type) ;
832- }
833- }
834798}
0 commit comments