predator4ann opened a new issue, #6656:
URL: https://github.com/apache/gravitino/issues/6656
### Version
main branch
### Describe what's wrong
When using the Trino connector to read MySQL tables containing timestamp
columns with precision specification (e.g., TIMESTAMP(6)), the query fails with
a type conversion error.
### Error message and/or stacktrace
```
trino> select created_at from ext.tmp.test_table limit 10;
created_at
------------
(0 rows)
Query 20250310_092550_25102_uxzme, FAILED, 1 node
Splits: 1 total, 1 done (100.00%)
0.57 [10 rows, 0B] [17 rows/s, 0B/s]
Query 20250310_092550_25102_uxzme failed: Could not serialize column
'created_at' of type 'timestamp(0)' at position 1:1
Caused by: java.lang.IllegalArgumentException: Expected 0s for digits beyond
precision 0: epochMicros = 1679540780487000
at io.trino.spi.type.SqlTimestamp.newInstance(SqlTimestamp.java:64)
at
io.trino.spi.type.ShortTimestampType.getObjectValue(ShortTimestampType.java:149)
at
io.trino.server.protocol.QueryResultRows$ResultsIterator.getRowValues(QueryResultRows.java:333)
```
### How to reproduce
1. Create a MySQL table with a timestamp column with precision:
```sql
CREATE TABLE tmp.test_table (
id INT PRIMARY KEY,
event_time TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6)
);
```
2. Insert sample data
```sql
INSERT INTO tmp.test_table VALUES (1, '2025-03-10 00:00:00');
```
3. Query the table through Gravitino's Trino connector
### Additional context
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]