Both of these are tragically pretty heavy changes which would require re-reading the whole schema again, so it might make sense to bundle these up.
ORDER BY (team_id, event, toStartOfHour(timestamp), distinct_id, cityHash64(uuid))
SAMPLE BY cityHash64(uuid)
Is your feature request related to a problem?
SAMPLE BY uuid.This does not work on clickhouse >= 21.7 due to Hash functions should be checked at table creation, not at sampling time ClickHouse/ClickHouse#822 and Check hash function at table creation ClickHouse/ClickHouse#26256.
We can't e.g.
SAMPLE BY cityHash64(uuid)because the expression needs to be in the sort key and a number. Related: ClickHouse M1 Docker #5215eventcolumn in the sort key since it's used in most of our queriesBoth of these are tragically pretty heavy changes which would require re-reading the whole schema again, so it might make sense to bundle these up.
Proposed solution:
Open questions:
ORDER BY (..., timestamp, ...)andORDER BY (..., toDate(timestamp), ...)etc? When to prefer one to the other?cc @fuziontech @tiina303 @yakkomajuri would you mind handling this as #team-platform?