Merge pull request #60258 from den-crane/tests/issue_60223

test for #60223
This commit is contained in:
Yarik Briukhovetskyi 2024-03-01 14:56:43 +01:00 committed by GitHub
commit 2961696574
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,10 @@
2
2
2
2
2
2
2
2
2
2

View File

@ -0,0 +1,27 @@
-- 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'});
insert into test select 'xxx', number, map('content-type', 'x' ) FROM numbers(1e2);
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');