Closed antoxa9898 closed 8 months ago
I tested it via Metabase with the following:
CREATE TABLE uniq_test
(
`gettime` DateTime64(3),
`uid` String
)
ENGINE = MergeTree
ORDER BY tuple()
INSERT INTO uniq_test VALUES (now(), 'foo'), (toDateTime64(now() - interval 2 day, 3), 'bar')
┌─────────────────gettime─┬─uid─┐
│ 2024-01-31 16:25:21.000 │ foo │
│ 2024-01-29 16:25:21.000 │ bar │
└─────────────────────────┴─────┘
SELECT
default.uniq_test.gettime AS gettime,
default.uniq_test.uid AS uid
FROM default.uniq_test
WHERE (default.uniq_test.gettime >= CAST(NOW(), 'date')) AND (default.uniq_test.gettime < CAST(NOW() + toIntervalDay(1), 'date'))
LIMIT 2000
┌─────────────────gettime─┬─uid─┐
│ 2024-01-31 16:25:21.000 │ foo │
└─────────────────────────┴─────┘
Does your generated query also return no rows when executed via CH client?
thanks for your hint. I tested creation table with your query and it works. after some tests i determined that promlem appears when datetime64 type field is primary or partition key. and after testing in different versions i determined that problem dissapeared in ClickHouse release 23.3. So this is clickhouse bug, not click metabase plugin
Describe the bug
When applying 'today' filter in metabase i have no results, but if i use specific date filter - on specific date(for example 29.01.23), i receive results. This issue appeared after i changed timestamp field in my clickhouse table from DateTime to DateTime64 type( i need to se MS).
Steps to reproduce
Configuration
Environment
this is my create table:
this is sql query which is generated by metabase: