@@ -13,7 +13,7 @@ use chrono::{DateTime, NaiveDate, NaiveDateTime, Utc};
1313
1414use deltalake:: DeltaTableError ;
1515use deltalake:: arrow:: array:: RecordBatch ;
16- use deltalake:: kernel:: { DataType as DeltaDataType } ;
16+ use deltalake:: kernel:: DataType as DeltaDataType ;
1717use deltalake:: operations:: collect_sendable_stream;
1818
1919use crate :: common:: delta:: { MinioDeltaLakeDatabase , setup_delta_connection} ;
@@ -793,16 +793,16 @@ async fn comprehensive_data_type_mapping() {
793793
794794 let columns = vec ! [
795795 ( "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)
802802 ( "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
806806 ] ;
807807
808808 let table_id = database
@@ -846,15 +846,38 @@ async fn comprehensive_data_type_mapping() {
846846 . await ;
847847
848848 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 ) ;
851854 let profile_data = b"Hello" . to_vec ( ) ;
852855
853856 database
854857 . insert_values (
855858 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+ ] ,
858881 )
859882 . await
860883 . unwrap ( ) ;
@@ -909,7 +932,8 @@ async fn comprehensive_data_type_mapping() {
909932 assert_eq ! (
910933 batch. num_columns( ) ,
911934 columns. len( ) ,
912- "Should have {} columns for comprehensive data types" , columns. len( )
935+ "Should have {} columns for comprehensive data types" ,
936+ columns. len( )
913937 ) ;
914938
915939 // Verify all expected columns are present
0 commit comments