apache / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://gravitino.apache.org
Apache License 2.0
1.1k stars 348 forks source link

[Bug report] MySQL catalog: Load MySQL TIMESTAMP data in Trino , it turns to TIMESTAMP WITH TIME ZONE data type #5658

Open danhuawang opened 3 days ago

danhuawang commented 3 days ago

Version

main branch

Describe what's wrong

In MySQL data source:

create table my_tb05 (col_timestamp TIMESTAMP);

insert into my_tb05 values (CURRENT_TIMESTAMP);

select * from my_tb05; 
+---------------------+
| col_timestamp       |
+---------------------+
| 2024-11-23 09:43:51 |
+---------------------+
1 row in set (0.01 sec)

Create MySQL catalog in Trino, load the data in MySQL:

call gravitino.system.create_catalog(
    'gt_mysql1',
    'jdbc-mysql',
    map(
        array['jdbc-url', 'jdbc-user', 'jdbc-password', 'jdbc-driver', 'trino.bypass.join-pushdown.strategy'],
        array['jdbc:mysql://10.20.31.20/?useSSL=false', 'trino', 'ds123', 'com.mysql.cj.jdbc.Driver', 'EAGER']
    )
);

create schema gt_mysql1.db1;

use gt_mysql1.db1;

 select * from my_tb05;
      col_timestamp      
-------------------------
 2024-11-23 09:43:51 UTC 

Error message and/or stacktrace

N/A

How to reproduce

refer to the description section

Additional context

No response

danhuawang commented 3 days ago

@diqiu50 Can you help check this issue?