mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
added test cases for bitmapContains
This commit is contained in:
parent
b694d039c1
commit
a477920206
@ -18,6 +18,8 @@
|
|||||||
90
|
90
|
||||||
90
|
90
|
||||||
20
|
20
|
||||||
|
90
|
||||||
|
20
|
||||||
2019-01-01 50
|
2019-01-01 50
|
||||||
2019-01-02 60
|
2019-01-02 60
|
||||||
1
|
1
|
||||||
@ -50,3 +52,10 @@
|
|||||||
0
|
0
|
||||||
1
|
1
|
||||||
0
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
1
|
||||||
|
@ -62,6 +62,10 @@ SELECT count(*) FROM bitmap_test WHERE bitmapHasAny(bitmapBuild([uid]), (SELECT
|
|||||||
|
|
||||||
SELECT count(*) FROM bitmap_test WHERE 0 = bitmapHasAny((SELECT groupBitmapState(uid) FROM bitmap_test WHERE pickup_date = '2019-01-01'), bitmapBuild([uid]));
|
SELECT count(*) FROM bitmap_test WHERE 0 = bitmapHasAny((SELECT groupBitmapState(uid) FROM bitmap_test WHERE pickup_date = '2019-01-01'), bitmapBuild([uid]));
|
||||||
|
|
||||||
|
SELECT count(*) FROM bitmap_test WHERE bitmapContains((SELECT groupBitmapState(uid) FROM bitmap_test WHERE pickup_date = '2019-01-01'), uid);
|
||||||
|
|
||||||
|
SELECT count(*) FROM bitmap_test WHERE 0 = bitmapContains((SELECT groupBitmapState(uid) FROM bitmap_test WHERE pickup_date = '2019-01-01'), uid);
|
||||||
|
|
||||||
-- bitmap state test
|
-- bitmap state test
|
||||||
DROP TABLE IF EXISTS bitmap_state_test;
|
DROP TABLE IF EXISTS bitmap_state_test;
|
||||||
CREATE TABLE bitmap_state_test
|
CREATE TABLE bitmap_state_test
|
||||||
@ -171,3 +175,21 @@ select bitmapHasAll(bitmapBuild([
|
|||||||
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,
|
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,
|
||||||
100,200,500]),bitmapBuild([ 100, 200, 501,
|
100,200,500]),bitmapBuild([ 100, 200, 501,
|
||||||
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]));
|
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]));
|
||||||
|
|
||||||
|
-- bitmapContains:
|
||||||
|
---- Empty
|
||||||
|
SELECT bitmapContains(bitmapBuild(emptyArrayUInt32()), CAST(0, 'UInt32'));
|
||||||
|
SELECT bitmapContains(bitmapBuild(emptyArrayUInt16()), CAST(5, 'UInt32'));
|
||||||
|
---- Small
|
||||||
|
select bitmapContains(bitmapBuild([1,5,7,9]),CAST(0, 'UInt32'));
|
||||||
|
select bitmapContains(bitmapBuild([1,5,7,9]),CAST(9, 'UInt32'));
|
||||||
|
---- Large
|
||||||
|
select bitmapContains(bitmapBuild([
|
||||||
|
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,
|
||||||
|
100,200,500]),CAST(100, 'UInt32'));
|
||||||
|
select bitmapContains(bitmapBuild([
|
||||||
|
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,
|
||||||
|
100,200,500]),CAST(101, 'UInt32'));
|
||||||
|
select bitmapContains(bitmapBuild([
|
||||||
|
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,
|
||||||
|
100,200,500]),CAST(500, 'UInt32'));
|
||||||
|
Loading…
Reference in New Issue
Block a user