Redshift does not sort properly in a dataflow


Hi I have the following query, which I sort by id and date. The id is sorted properly however the date is still random. The date is in a timestamp format, but I tried casting it to ::date, there was no effect on sorting:


select distinct "id"
app."App ID",
from "appointments" as app
left join "id table" as t on app."ID" = t."id"
where opp."country" = 'PL'
and "Visited"='t'
and "Device" is not null
order by "ID", "Date"::date asc


Any idea why the date would not be in ascending order after running the query??