@@ -13,7 +13,7 @@ use chrono::{DateTime, NaiveDate, NaiveDateTime, Utc};
13
13
14
14
use deltalake:: DeltaTableError ;
15
15
use deltalake:: arrow:: array:: RecordBatch ;
16
- use deltalake:: kernel:: { DataType as DeltaDataType } ;
16
+ use deltalake:: kernel:: DataType as DeltaDataType ;
17
17
use deltalake:: operations:: collect_sendable_stream;
18
18
19
19
use crate :: common:: delta:: { MinioDeltaLakeDatabase , setup_delta_connection} ;
@@ -793,16 +793,16 @@ async fn comprehensive_data_type_mapping() {
793
793
794
794
let columns = vec ! [
795
795
( "id" , "bigint primary key" ) , // Manually define id column without sequence
796
- ( "name" , "text" ) , // TEXT -> STRING
797
- ( "age" , "int4" ) , // INT4 -> INTEGER
798
- ( "height" , "float8" ) , // FLOAT8 -> DOUBLE
799
- ( "active" , "bool" ) , // BOOL -> BOOLEAN
800
- ( "birth_date" , "date" ) , // DATE -> DATE
801
- ( "created_at" , "timestamp" ) , // TIMESTAMP -> TIMESTAMP_NTZ (no timezone)
796
+ ( "name" , "text" ) , // TEXT -> STRING
797
+ ( "age" , "int4" ) , // INT4 -> INTEGER
798
+ ( "height" , "float8" ) , // FLOAT8 -> DOUBLE
799
+ ( "active" , "bool" ) , // BOOL -> BOOLEAN
800
+ ( "birth_date" , "date" ) , // DATE -> DATE
801
+ ( "created_at" , "timestamp" ) , // TIMESTAMP -> TIMESTAMP_NTZ (no timezone)
802
802
( "updated_at" , "timestamptz" ) , // TIMESTAMPTZ -> TIMESTAMP (with timezone)
803
- ( "profile_data" , "bytea" ) , // BYTEA -> BINARY
804
- //("salary", "numeric(10,2)"), // NUMERIC -> DECIMAL
805
- // TODO(abhi): Decimal type is currently causing hangs
803
+ ( "profile_data" , "bytea" ) , // BYTEA -> BINARY
804
+ //("salary", "numeric(10,2)"), // NUMERIC -> DECIMAL
805
+ // TODO(abhi): Decimal type is currently causing hangs
806
806
] ;
807
807
808
808
let table_id = database
@@ -846,15 +846,38 @@ async fn comprehensive_data_type_mapping() {
846
846
. await ;
847
847
848
848
let birth_date = NaiveDate :: from_ymd_opt ( 1993 , 1 , 15 ) . unwrap ( ) ;
849
- let created_at = NaiveDateTime :: parse_from_str ( "2023-01-01 12:00:00" , "%Y-%m-%d %H:%M:%S" ) . unwrap ( ) ;
850
- let updated_at = DateTime :: parse_from_rfc3339 ( "2023-01-01T12:00:00+00:00" ) . unwrap ( ) . with_timezone ( & Utc ) ;
849
+ let created_at =
850
+ NaiveDateTime :: parse_from_str ( "2023-01-01 12:00:00" , "%Y-%m-%d %H:%M:%S" ) . unwrap ( ) ;
851
+ let updated_at = DateTime :: parse_from_rfc3339 ( "2023-01-01T12:00:00+00:00" )
852
+ . unwrap ( )
853
+ . with_timezone ( & Utc ) ;
851
854
let profile_data = b"Hello" . to_vec ( ) ;
852
855
853
856
database
854
857
. insert_values (
855
858
table_name. clone ( ) ,
856
- & [ "id" , "name" , "age" , "height" , "active" , "birth_date" , "created_at" , "updated_at" , "profile_data" ] ,
857
- & [ & 1i64 , & "John Doe" , & 30i32 , & 5.9f64 , & true , & birth_date, & created_at, & updated_at, & profile_data] ,
859
+ & [
860
+ "id" ,
861
+ "name" ,
862
+ "age" ,
863
+ "height" ,
864
+ "active" ,
865
+ "birth_date" ,
866
+ "created_at" ,
867
+ "updated_at" ,
868
+ "profile_data" ,
869
+ ] ,
870
+ & [
871
+ & 1i64 ,
872
+ & "John Doe" ,
873
+ & 30i32 ,
874
+ & 5.9f64 ,
875
+ & true ,
876
+ & birth_date,
877
+ & created_at,
878
+ & updated_at,
879
+ & profile_data,
880
+ ] ,
858
881
)
859
882
. await
860
883
. unwrap ( ) ;
@@ -909,7 +932,8 @@ async fn comprehensive_data_type_mapping() {
909
932
assert_eq ! (
910
933
batch. num_columns( ) ,
911
934
columns. len( ) ,
912
- "Should have {} columns for comprehensive data types" , columns. len( )
935
+ "Should have {} columns for comprehensive data types" ,
936
+ columns. len( )
913
937
) ;
914
938
915
939
// Verify all expected columns are present
0 commit comments