ClickHouse/dbms/tests/queries/0_stateless/00944_minmax_null.sql

24 lines
940 B
MySQL
Raw Normal View History

2019-05-12 17:01:36 +00:00
DROP TABLE IF EXISTS min_max_with_nullable_string;
SET allow_experimental_data_skipping_indices = 1;
CREATE TABLE min_max_with_nullable_string (
t DateTime,
nullable_str Nullable(String),
INDEX nullable_str_min_max nullable_str TYPE minmax GRANULARITY 8192
) ENGINE = MergeTree ORDER BY (t);
INSERT INTO min_max_with_nullable_string(t) VALUES (now()) (now());
2019-05-12 17:08:28 +00:00
SELECT count() FROM min_max_with_nullable_string WHERE nullable_str = '.';
2019-05-12 17:01:36 +00:00
INSERT INTO min_max_with_nullable_string(t, nullable_str) VALUES (now(), '.') (now(), '.');
2019-05-12 17:08:28 +00:00
SELECT count() FROM min_max_with_nullable_string WHERE nullable_str = '.';
2019-05-12 17:01:36 +00:00
INSERT INTO min_max_with_nullable_string(t, nullable_str) VALUES (now(), NULL) (now(), '.') (now(), NULL) (now(), '.') (now(), NULL);
2019-05-12 17:08:28 +00:00
SELECT count() FROM min_max_with_nullable_string WHERE nullable_str = '.';
2019-05-12 17:01:36 +00:00
2019-05-12 17:08:28 +00:00
SELECT count() FROM min_max_with_nullable_string WHERE nullable_str = '';
2019-05-12 17:01:36 +00:00
DROP TABLE min_max_with_nullable_string;