Presto Timestamp types are being identified as UNKNOWN datatype
See original GitHub issueA clear and concise description of what the bug is.
PrestoSQL Version - 341 SuperSet Version - 0.37.2
I have a table in Presto that has 1250 columns. 118 of these columns are timestamp type. When I add this table under Sources -> Tables -> Add a new record, all these timestamps are being identified as UNKNOWN. However, when I manually edit each timestamp column and change UNKNOWN -> TIMESTAMP, it all works fine as expected.
I tried the same in master build docker image. Data -> Datasets -> Add a new record referencing the table in DB. All timestamp fields are being identified as UNKNOWN type.
Adding the DB table in the below screen
what you expected to happen. timestamp(3) which is the native timestamp of Presto should be identified as timestamp
what actually happens.
Screenshots
If applicable, add screenshots to help explain your problem. Below screenshot is shown from the image built from master:
How to reproduce the bug
- Have a Presto table defined with timestamp field in it.
- Add a presto connection in the database section.
- Go to Sources -> Tables -> Add a new record
- Click on edit record -> COLUMNS -> check the timestamp type you stored in DB.
Environment
(please complete the following information):
- superset version:
0.37.2
- python version:
3.6
Using docker image for 0.37.2 from https://hub.docker.com/layers/amancevice/superset/0.37.2/images/sha256-0036adb5d313cd8dd1263a843e501380162c57bf70c616913d1613c390a00950?context=explore
Checklist
Make sure these boxes are checked before submitting your issue - thank you!
- [y] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [y] I have reproduced the issue with at least the latest released version of superset.
- [y] I have checked the issue tracker for the same issue and I haven’t found one similar.
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
So, to whoever is running into this problem, the issue should have happened post-Presto 338 release where the timestamp is a parametric timestamp type (timestamp with different precision).
https://github.com/prestosql/presto/pull/4349
This is what I did to resolve the problem. Updated my database connection and specific extra field with the following:
Make a note of the “omit_datetime_type_precision”: true property. Refer: https://prestosql.io/docs/current/release/release-338.html
This works fine now after I added the flag. I will leave it to Superset developers if they want to add a fix for it.
Sounds good.