ClickHouse/tests/queries/0_stateless/02241_join_rocksdb_bs.sql.j2

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1.3 KiB
Plaintext
Raw Normal View History

2024-07-22 09:10:34 +00:00
-- Tags: use-rocksdb, long, no-s3-storage
2022-03-21 15:02:52 +00:00
SET join_algorithm = 'direct';
{% for table_size in [10, 65555, 100000] -%}
2022-03-22 16:33:03 +00:00
DROP TABLE IF EXISTS rdb_{{ table_size }};
{% endfor -%}
2022-03-21 15:02:52 +00:00
2022-03-22 16:33:03 +00:00
{% for table_size in [10, 65555, 100000] -%}
2022-03-21 15:02:52 +00:00
2022-03-22 16:33:03 +00:00
CREATE TABLE rdb_{{ table_size }} (key UInt64, value String) ENGINE = EmbeddedRocksDB PRIMARY KEY (key);
INSERT INTO rdb_{{ table_size }}
SELECT (sipHash64(number) % {{ table_size }}) as key, ('val' || toString(key)) AS value
FROM numbers_mt({{ table_size }});
2022-03-21 15:02:52 +00:00
{% for right_size in [table_size // 2, table_size + table_size // 4 + 1] -%}
2022-03-22 16:33:03 +00:00
SELECT count() == (SELECT count() FROM rdb_{{ table_size }} WHERE key < {{ right_size }})
2022-03-21 15:02:52 +00:00
FROM (SELECT number as k FROM numbers_mt({{ right_size }})) as t1
2022-03-22 16:33:03 +00:00
INNER JOIN rdb_{{ table_size }} as rdb
2024-07-22 09:10:34 +00:00
ON rdb.key == t1.k
{% if table_size < 100 %}SETTINGS max_block_size = 1{% endif -%}
;
2022-03-21 15:02:52 +00:00
2022-03-22 16:33:03 +00:00
SELECT count() == {{ right_size }} and countIf(value != '') == (SELECT count() FROM rdb_{{ table_size }} WHERE key < {{ right_size }})
2022-03-21 15:02:52 +00:00
FROM (SELECT number as k FROM numbers_mt({{ right_size }})) as t1
2022-03-22 16:33:03 +00:00
LEFT JOIN rdb_{{ table_size }} as rdb
2024-07-22 09:10:34 +00:00
ON rdb.key == t1.k
{% if table_size < 100 %}SETTINGS max_block_size = 1{% endif -%}
;
2022-03-21 15:02:52 +00:00
{% endfor -%}
{% endfor -%}
2022-03-22 16:33:03 +00:00
{% for table_size in [10, 65555, 100000] -%}
DROP TABLE IF EXISTS rdb_{{ table_size }};
{% endfor -%}