Time series is not working in visulaization.

918 views
Skip to first unread message

JongOk Kim

unread,
Apr 11, 2017, 11:57:24 PM4/11/17
to airbnb_superset
Hi.

I'm using presto as backend.
when I use visualization like 'bar chart' then time setting is not working.

superset log is shown below.
----------------------------------------------------------------------
SELECT *
FROM test
WHERE "target_date" >= '1917-04-12 03:38:18' AND "target_date" <= '2017-04-12 03:38:18'

{'errorType': 'USER_ERROR', 
'message': "line 8:21: '>=' cannot be applied to date, varchar(19)", 
'errorName': 'SYNTAX_ERROR', 
'errorLocation': {'lineNumber': 8, 'columnNumber': 21}, 
'errorCode': 1, 
'failureInfo': {'suppressed': [], 'message': "line 8:21: '>=' cannot be applied to date, varchar(19)", 
'type': 'com.facebook.presto.sql.analyzer.SemanticException', 'stack': 
----------------------------------------------------------------------

I think query is wrong in presto backend.
How can I set up presto database to run following query in visualization?
----------------------------------------------------------------------
SELECT *
FROM test
WHERE "target_date" >= timestamp '1917-04-12 03:38:18' AND "target_date" <= timestamp '2017-04-12 03:38:18'
----------------------------------------------------------------------

Thanks.


Ben Vogan

unread,
Apr 12, 2017, 12:35:55 AM4/12/17
to JongOk Kim, airbnb_superset
Hi there,

You need to properly configure your table so that superset can format the date. You need to edit your date columns and fill out the Datetime Format (probably %Y-%m-%d %H:%M:%S) and Database Expression (probably parse_datetime('{}', 'yyyy-MM-dd HH:mm:ss')) fields.

--Ben

--
You received this message because you are subscribed to the Google Groups "airbnb_superset" group.
To unsubscribe from this group and stop receiving emails from it, send an email to airbnb_superset+unsubscribe@googlegroups.com.
To post to this group, send email to airbnb_superset@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/airbnb_superset/b983772d-6853-49ea-a3b5-bea06477f46d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
BENJAMIN VOGAN | Data Platform Team Lead

Maxime Beauchemin

unread,
Apr 12, 2017, 1:14:41 AM4/12/17
to airbnb_superset, jon...@gmail.com
What version are you using? In recent versions we have good support for Presto date types. If the target column is a DATE or DATETIME it will cast the time filter constant to a date as it generates the SQL.

Max

JongOk Kim

unread,
Apr 13, 2017, 10:37:01 PM4/13/17
to airbnb_superset, jon...@gmail.com
I using latest version.
It was my fault.

'target_date' column is not date type. It was string type.

I tested another case and it worked well.


thanks.


Reply all
Reply to author
Forward
0 new messages