Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query 20240119_063836_00856_pugph failed: Unsupported column type: timestamp #21731

Closed
JxKim opened this issue Jan 19, 2024 · 5 comments · Fixed by #21937
Closed

Query 20240119_063836_00856_pugph failed: Unsupported column type: timestamp #21731

JxKim opened this issue Jan 19, 2024 · 5 comments · Fixed by #21937
Labels

Comments

@JxKim
Copy link

JxKim commented Jan 19, 2024

I was trying to use MySql connector and inserting datas which are results selected from other tables into the mysql table.
There is a column with datetime type in the dest table. When I executed the 'insert into select' query, an exception occurred.
Now I can only create a tmp table in MySql and use it as a bridge. Why timestamp not supported yet???

  • Presto version used:0.280-A95C1B4
  • Storage (HDFS/S3/GCS..):
  • Data source and connector used: mysql connector

Possible Solution

Steps to Reproduce

Screenshots (if appropriate)

Uploading image.png…

@yhwang
Copy link
Member

yhwang commented Jan 22, 2024

Can you provide the stack trace and SQL you are using? I guess you tried to upload a screenshot but the link just points back to this issue.

@Akanksha-kedia
Copy link
Contributor

@JxKim According to me, what i understood from mentioned above "The issue you're encountering is likely due to the way Presto handles TIMESTAMP data types. Presto has its own internal representation for TIMESTAMP, and it may not always map perfectly to the TIMESTAMP or DATETIME types in MySQL.

As of now, the Presto MySQL connector only supports a subset of MySQL's data types, and the support for TIMESTAMP is limited. This is a known limitation and is documented in the Presto's official documentation.

As a workaround, you could convert the TIMESTAMP columns to a string format that Presto can handle, perform your operations, and then convert them back to TIMESTAMP in MySQL if necessary. You could also consider using a different connector that fully supports TIMESTAMP, like the PostgreSQL connector, if switching databases is an option for you."

@JxKim
Copy link
Author

JxKim commented Feb 11, 2024

@JxKim According to me, what i understood from mentioned above "The issue you're encountering is likely due to the way Presto handles TIMESTAMP data types. Presto has its own internal representation for TIMESTAMP, and it may not always map perfectly to the TIMESTAMP or DATETIME types in MySQL.

As of now, the Presto MySQL connector only supports a subset of MySQL's data types, and the support for TIMESTAMP is limited. This is a known limitation and is documented in the Presto's official documentation.

As a workaround, you could convert the TIMESTAMP columns to a string format that Presto can handle, perform your operations, and then convert them back to TIMESTAMP in MySQL if necessary. You could also consider using a different connector that fully supports TIMESTAMP, like the PostgreSQL connector, if switching databases is an option for you."

why is mysql connector not supporting datetime mapping yet? Are there any technical reasons for this?

@yhwang
Copy link
Member

yhwang commented Feb 12, 2024

This is no technical issue/reason for this limitation. If you'd like to have a PR for this, it would be great!

@hantangwangd
Copy link
Member

@Akanksha-kedia @yhwang @JxKim I have rose a PR to support timestamp in mysql connector. Please take a look, thanks!

@github-project-automation github-project-automation bot moved this from 🆕 Unprioritized to ✅ Done in Bugs and support requests Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants