ClickHouse/tests/queries/0_stateless/02983_empty_map_hasToken.sql

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

28 lines
1.6 KiB
MySQL
Raw Normal View History

2024-02-21 21:56:09 +00:00
-- https://github.com/ClickHouse/ClickHouse/issues/60223
CREATE TABLE test
(
t String,
id String,
h Map(String, String)
)
ENGINE = MergeTree
ORDER BY (t, id) SETTINGS index_granularity = 4096 ;
insert into test values ('xxx', 'x', {'content-type':'text/plain','user-agent':'bulk-tests'});
insert into test values ('xxx', 'y', {'content-type':'application/json','user-agent':'bulk-tests'});
2024-02-27 12:56:16 +00:00
insert into test select 'xxx', number, map('content-type', 'x' ) FROM numbers(1e2);
2024-02-21 21:56:09 +00:00
optimize table test final;
SELECT count() FROM test PREWHERE hasToken(h['user-agent'], 'bulk') WHERE hasToken(h['user-agent'], 'tests') and t = 'xxx';
SELECT count() FROM test PREWHERE hasToken(h['user-agent'], 'tests') WHERE hasToken(h['user-agent'], 'bulk') and t = 'xxx';
SELECT count() FROM test WHERE hasToken(h['user-agent'], 'bulk') and hasToken(h['user-agent'], 'tests') and t = 'xxx';
SELECT count() FROM test PREWHERE hasToken(h['user-agent'], 'bulk') and hasToken(h['user-agent'], 'tests') and t = 'xxx';
SELECT count() FROM test PREWHERE hasToken(h['user-agent'], 'bulk') and hasToken(h['user-agent'], 'tests') WHERE t = 'xxx';
SELECT count() FROM test PREWHERE hasToken(h['user-agent'], 'tests') and hasToken(h['user-agent'], 'bulk') WHERE t = 'xxx';
SELECT count() FROM test PREWHERE hasToken(h['user-agent'], 'tests') and hasToken(h['user-agent'], 'bulk');
SELECT count() FROM test PREWHERE hasToken(h['user-agent'], 'bulk') and hasToken(h['user-agent'], 'tests');
SELECT count() FROM test WHERE hasToken(h['user-agent'], 'tests') and hasToken(h['user-agent'], 'bulk');
SELECT count() FROM test WHERE hasToken(h['user-agent'], 'bulk') and hasToken(h['user-agent'], 'tests');