From ddad564babe0d565257881b2446e428aad215c5b Mon Sep 17 00:00:00 2001 From: Zhichang Yu Date: Tue, 4 Jun 2019 16:17:37 +0800 Subject: [PATCH] added function test for bitmapHasAny + scalar subquery --- .../queries/0_stateless/00829_bitmap_function.reference | 3 +++ dbms/tests/queries/0_stateless/00829_bitmap_function.sql | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/dbms/tests/queries/0_stateless/00829_bitmap_function.reference b/dbms/tests/queries/0_stateless/00829_bitmap_function.reference index 9345dc6b3c7..899e7a3e8ef 100644 --- a/dbms/tests/queries/0_stateless/00829_bitmap_function.reference +++ b/dbms/tests/queries/0_stateless/00829_bitmap_function.reference @@ -15,6 +15,9 @@ 2019-01-02 60 [11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70] 60 50 70 40 20 30 60 50 70 40 20 30 +90 +90 +20 2019-01-01 50 2019-01-02 60 1 diff --git a/dbms/tests/queries/0_stateless/00829_bitmap_function.sql b/dbms/tests/queries/0_stateless/00829_bitmap_function.sql index cca6c909c47..a5873444d99 100644 --- a/dbms/tests/queries/0_stateless/00829_bitmap_function.sql +++ b/dbms/tests/queries/0_stateless/00829_bitmap_function.sql @@ -56,6 +56,12 @@ ALL LEFT JOIN ) USING city_id; +SELECT count(*) FROM bitmap_test WHERE bitmapHasAny((SELECT groupBitmapState(uid) FROM bitmap_test WHERE pickup_date = '2019-01-01'), bitmapBuild([uid])); + +SELECT count(*) FROM bitmap_test WHERE bitmapHasAny(bitmapBuild([uid]), (SELECT groupBitmapState(uid) FROM bitmap_test WHERE pickup_date = '2019-01-01')); + +SELECT count(*) FROM bitmap_test WHERE 0 = bitmapHasAny((SELECT groupBitmapState(uid) FROM bitmap_test WHERE pickup_date = '2019-01-01'), bitmapBuild([uid])); + -- bitmap state test DROP TABLE IF EXISTS bitmap_state_test; CREATE TABLE bitmap_state_test