-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Extra % added in SQL Lab during visualisation #3209
Comments
I found a way to get the right format.
Now the query looks as expected, but I need to check if its the right now. |
Which database engine are you querying? I have a fix out on master for Presto. We can replicate the fix for other DB. It has to be dealt with on a per-engine basis as DBAPI implementation vary a bit on how and whether to escape |
Hi @mistercrunch, it's a Mysql from AWS RDS. I looked to your fix, indeed, that the way ;) |
Somehow with the mysql driver I use ( |
Notice: this issue has been closed because it has been inactive for 264 days. Feel free to comment and request for this issue to be reopened. |
Make sure these boxes are checked before submitting your issue - thank you!
Superset version
{"GIT_SHA": "", "version": "0.18.5"}
Expected results
A list grouped by time (hourly) and type (24 columns, with 2 type, breakdown to display them
Actual results
It works well when I edit my query, then when I visualize, the result is not right. Only 2 column instead of 24
Steps to reproduce
Here is my SQL query:
SELECT
count(*) as 'total_activities', type, hour(
datetime
) as hourlyFROM activity
GROUP BY
type
, DATE_FORMAT(datetime
, "%%H:00:00") ORDER BY
datetime` ASC;The visualised query looks like :
SELECT hourly AS hourly,
type AS type,
sum(total_activities) AS sum__total_activities
FROM
(SELECT count(*) as 'total_activities',
type,
hour(
datetime
) as hourlyFROM activity
GROUP BY
type
,DATE_FORMAT(
datetime
, "%%%%H:00:00")ORDER BY
datetime
ASC) AS expr_qryGROUP BY hourly,
type
ORDER BY sum__total_activities DESC
LIMIT 50000
As you see, it adds 2 extra "%%" in the DATE_FORMAT, so the result for hourly will return only "0" instead of the 12 or 24 hours (depending of the format needed)
I copy paste this query and delete the 2 extra '%', it seems to work as expected.
Is this normal ? Or did I miss something ? Maybe better way to display ma data by hour for a 24 hour grouped with type of activity ?
Thanks
Edit: I tried to trick it like having online one '%' as "%H" mais I got the error : {"status": "failed", "query_id": 46, "error_essage": "unsupported format character 'H' (0x48) at index 250"}
The text was updated successfully, but these errors were encountered: