Closed vincentbernat closed 2 months ago
@shreesham another clickhouse issue that could use some validation in current Superset if we're able.
@rusackas looks like the same thing I just posted here: https://github.com/apache/superset/issues/19404#issuecomment-1700171750.
Look at the query @vincentbernat posted
SELECT toStartOfMinute(toDateTime("TimeReceived")) AS __timestamp,
"SrcAS" AS "SrcAS",
SUM(Bytes*SamplingRate) AS "Bytes"
FROM "default".flows
WHERE "Date" >= toDate('2022-03-15')
AND "Date" < toDate('2022-03-15')
AND "TimeReceived" >= toDateTime('2022-03-15 08:27:07')
AND "TimeReceived" < toDateTime('2022-03-15 14:27:07')
GROUP BY "SrcAS",
toStartOfMinute(toDateTime("TimeReceived"))
ORDER BY "Bytes" DESC
LIMIT 10000
It has a double filter by dates which is likely to result in no matches being returned.
I bet Date
field is the default datetime column on the Dataset and TimeReceived
is the TIME COLUMN of the chart. @vincentbernat can you confirm ?
Yes. In the meantime, I was told it was possible to partition with an expression, so no need to have a Date
column. This should also fix the issue here. Nonetheless, people keeping a separate column for that will still run into this issue.
If there's a workaround, is there still a real "bug" here, or is there a proposal of how to resolve this? Maybe there should be an addition to the documentation on the Clickhouse page if this is indeed a Clickhouse issue?
Sounds like there's no activity here, so I'll close this as stale. Holler if it ought to be reopened, though anyone is able to improve docs or open PRs to dial things in with or without the issue being open :)
Often, Clickhouse tables have both a
Date
and aDateTime
column. The first one is to help data partitioning. The Clickhouse driver in Superset is correctly including both of them when specifying time ranges. However, when the requested length is less than a day, it generates an SQL request which cannot have a result as the start day is inclusive and the end day is exclusive.How to reproduce the bug
TimeReceived
as a time column and a time range of 6 hours.Expected results
I should get some data.
Actual results
No data available.
Screenshots
Here is the generated SQL request:
Environment
Checklist
Make sure to follow these steps before submitting your issue - thank you!