superset icon indicating copy to clipboard operation
superset copied to clipboard

Support presto TIMESTAMP

Open bkyryliuk opened this issue 10 years ago • 11 comments

Support the presto timestamps and the date fields. Slicing the table that has date column of the time Timestamp generates the query:

SELECT COUNT(*) AS "count" 
FROM $TABLE_NAME
WHERE
  call_date >= '2016-09-20 13:57:53.000000' 
     AND 
  call_date <= '2016-09-27 13:57:53.000000'
LIMIT 50000

and gives an error:

u'java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)', u'java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)', u'java.lang.Thread.run(Thread.java:745)']}, u'errorType': u'USER_ERROR', u'errorName': u'SYNTAX_ERROR', u'errorCode': 1, u'message': u'line 3:19: Operator GREATER_THAN_OR_EQUAL(timestamp, varchar) not registered'}

bkyryliuk avatar Sep 27 '16 21:09 bkyryliuk

https://github.com/airbnb/caravel/issues/1098

mistercrunch avatar Sep 27 '16 22:09 mistercrunch

workaround: screen shot 2016-09-27 at 3 47 50 pm

bkyryliuk avatar Sep 27 '16 22:09 bkyryliuk

Workaround is not good enough - CAST(to_iso8601(call_date) AS TIMESTAMP) fails on the presto side with an error: Invalid format: \"2016-09-26T21:39:00.000Z\" is malformed at \"T21:39:00.000Z\"',

bkyryliuk avatar Sep 27 '16 23:09 bkyryliuk

Workaround #2: screen shot 2016-09-28 at 1 44 48 pm

bkyryliuk avatar Sep 28 '16 20:09 bkyryliuk

Max solved it

bkyryliuk avatar Mar 09 '17 23:03 bkyryliuk

@bkyryliuk what was the solution? Im experiencing this now, and asking users to use date.format expression on any timestamp column isnt really that viable. Perhaps ive misunderstood?

ghost avatar Jul 26 '18 15:07 ghost

This was tackled fairly recently. May not be in the latest version.

mistercrunch avatar Jul 26 '18 16:07 mistercrunch

@mistercrunch gotcha, looking forward to solution. Let me know if I can help.

ghost avatar Jul 26 '18 17:07 ghost

@mistercrunch would you be able to point us to the git issue were this was resolved? I am only seeing the performance VARBINARY issues being resolved. Very much appreciated.

rpwils avatar Aug 16 '18 19:08 rpwils

What is the solution to this? I'm running against the same problem decribed in the first post in this thread.

dennari avatar Jan 19 '20 20:01 dennari

@dennari Would you be able to open a new ticket so we can investigate further? If you are on a recent version this should already work, as we're no longer comparing to strings but native TIMESTAMPs:

https://github.com/apache/incubator-superset/blob/0.35/superset/db_engine_specs/presto.py#L527-L528

villebro avatar Jan 20 '20 15:01 villebro