@@ -375,7 +375,27 @@ def __iter__(self):
375375 "uuid" : [
376376 "STRING" ,
377377 ]
378- }
378+ },
379+ db .Trino : {
380+ "int" : [
381+ "int" ,
382+ "bigint" ,
383+ ],
384+ "datetime" : [
385+ "timestamp" ,
386+ "timestamp with time zone" ,
387+ ],
388+ "float" : [
389+ "real" ,
390+ "double" ,
391+ "decimal(10,2)" ,
392+ "decimal(30,6)" ,
393+ ],
394+ "uuid" : [
395+ "varchar" ,
396+ "char(100)" ,
397+ ],
398+ },
379399}
380400
381401
@@ -460,7 +480,7 @@ def _insert_to_table(conn, table, values, type):
460480
461481 if isinstance (sample , (float , Decimal , int )):
462482 value = str (sample )
463- elif isinstance (sample , datetime ) and isinstance (conn , (db .Presto , db .Oracle )):
483+ elif isinstance (sample , datetime ) and isinstance (conn , (db .Presto , db .Oracle , db . Trino )):
464484 value = f"timestamp '{ sample } '"
465485 elif isinstance (sample , datetime ) and isinstance (conn , db .BigQuery ) and type == 'datetime' :
466486 value = f"cast(timestamp '{ sample } ' as datetime)"
@@ -492,7 +512,7 @@ def _insert_to_table(conn, table, values, type):
492512def _create_indexes (conn , table ):
493513 # It is unfortunate that Presto doesn't support creating indexes...
494514 # Technically we could create it in the backing Postgres behind the scenes.
495- if isinstance (conn , (db .Snowflake , db .Redshift , db .Presto , db .BigQuery , db .Databricks )):
515+ if isinstance (conn , (db .Snowflake , db .Redshift , db .Presto , db .BigQuery , db .Databricks , db . Trino )):
496516 return
497517
498518 try :
@@ -583,7 +603,7 @@ def test_types(self, source_db, target_db, source_type, target_type, type_catego
583603 insertion_source_duration = time .time () - start
584604
585605 values_in_source = PaginatedTable (src_table , src_conn )
586- if source_db is db .Presto :
606+ if source_db is db .Presto or source_db is db . Trino :
587607 if source_type .startswith ("decimal" ):
588608 values_in_source = ((a , Decimal (b )) for a , b in values_in_source )
589609 elif source_type .startswith ("timestamp" ):
0 commit comments