-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Picking a date column for sorting results in "day" granularity sort order #2531
Comments
@tlrobinson can you explain a bit more how you are reproducing this? I'm not seeing this happen. |
So, this is ultimately an issue on the backend where running a https://github.com/metabase/metabase/blame/master/src/metabase/query_processor/resolve.clj#L106 For example when I run the above query I see the following, which is not the correct SQL because the order by clause should not be casting the created_at column to a date:
|
@agilliland So I think we agreed the correct fix is:
I can handle 1, do you or @camsaul want to take 2? |
@camsaul raw rows should definitely not cast the timestamp to a date. This is incorrect, and should be fixed. We can and should default to timezone when charting aggregates by a timestamp, but in this case it is incorrect. |
Ok @tlrobinson part 2 is merged so I'm going to assign this back to you so you can tackle part 1. |
Re-opening as the fix for this wasn't correct. The resulting behavior is incorrect and a hard blocker on 0.17.1 |
Fixed by #2586 |
When selecting a date column in the sort picker we incorrectly include "day" as the unit, causing rows to be sorted by day but sometimes not sorted correctly within each day.
Note that clicking a table header doesn't cause the unit to be included, so it sorts correctly. This can be used as a workaround until we fix this issue.
The text was updated successfully, but these errors were encountered: