From e1f3ef2115cdfdbbe49b4812dcfb7d4c0879d691 Mon Sep 17 00:00:00 2001 From: Zhichang Yu Date: Mon, 5 Aug 2019 10:27:12 +0800 Subject: [PATCH] renamed bitmapRange to bitmapSubsetInRange --- dbms/src/Functions/FunctionsBitmap.cpp | 2 +- dbms/src/Functions/FunctionsBitmap.h | 10 +++++----- .../0_stateless/00829_bitmap_function.sql | 18 +++++++++--------- .../functions/bitmap_functions.md | 8 ++++---- .../functions/bitmap_functions.md | 6 +++--- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dbms/src/Functions/FunctionsBitmap.cpp b/dbms/src/Functions/FunctionsBitmap.cpp index af7daddd773..b2bb1e4f25a 100644 --- a/dbms/src/Functions/FunctionsBitmap.cpp +++ b/dbms/src/Functions/FunctionsBitmap.cpp @@ -9,7 +9,7 @@ void registerFunctionsBitmap(FunctionFactory & factory) { factory.registerFunction(); factory.registerFunction(); - factory.registerFunction(); + factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); diff --git a/dbms/src/Functions/FunctionsBitmap.h b/dbms/src/Functions/FunctionsBitmap.h index 3aaf8e0b497..22964605b8b 100644 --- a/dbms/src/Functions/FunctionsBitmap.h +++ b/dbms/src/Functions/FunctionsBitmap.h @@ -30,8 +30,8 @@ namespace ErrorCodes * Convert bitmap to integer array: * bitmapToArray: bitmap -> integer[] * - * Return new set with specified range (not include the range_end): - * bitmapRange: bitmap,integer,integer -> bitmap + * Return subset in specified range (not include the range_end): + * bitmapSubsetInRange: bitmap,integer,integer -> bitmap * * Two bitmap and calculation: * bitmapAnd: bitmap,bitmap -> bitmap @@ -243,12 +243,12 @@ private: } }; -class FunctionBitmapRange : public IFunction +class FunctionBitmapSubsetInRange : public IFunction { public: - static constexpr auto name = "bitmapRange"; + static constexpr auto name = "bitmapSubsetInRange"; - static FunctionPtr create(const Context &) { return std::make_shared(); } + static FunctionPtr create(const Context &) { return std::make_shared(); } String getName() const override { return name; } diff --git a/dbms/tests/queries/0_stateless/00829_bitmap_function.sql b/dbms/tests/queries/0_stateless/00829_bitmap_function.sql index f03239a1378..247a9ba3960 100644 --- a/dbms/tests/queries/0_stateless/00829_bitmap_function.sql +++ b/dbms/tests/queries/0_stateless/00829_bitmap_function.sql @@ -193,21 +193,21 @@ 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]),toUInt32(500)); --- bitmapRange: +-- bitmapSubsetInRange: ---- Empty -SELECT bitmapToArray(bitmapRange(bitmapBuild(emptyArrayUInt32()), toUInt32(0), toUInt32(10))); -SELECT bitmapToArray(bitmapRange(bitmapBuild(emptyArrayUInt16()), toUInt32(0), toUInt32(10))); +SELECT bitmapToArray(bitmapSubsetInRange(bitmapBuild(emptyArrayUInt32()), toUInt32(0), toUInt32(10))); +SELECT bitmapToArray(bitmapSubsetInRange(bitmapBuild(emptyArrayUInt16()), toUInt32(0), toUInt32(10))); ---- Small -select bitmapToArray(bitmapRange(bitmapBuild([1,5,7,9]), toUInt32(0), toUInt32(4))); -select bitmapToArray(bitmapRange(bitmapBuild([1,5,7,9]), toUInt32(10), toUInt32(10))); -select bitmapToArray(bitmapRange(bitmapBuild([1,5,7,9]), toUInt32(3), toUInt32(7))); +select bitmapToArray(bitmapSubsetInRange(bitmapBuild([1,5,7,9]), toUInt32(0), toUInt32(4))); +select bitmapToArray(bitmapSubsetInRange(bitmapBuild([1,5,7,9]), toUInt32(10), toUInt32(10))); +select bitmapToArray(bitmapSubsetInRange(bitmapBuild([1,5,7,9]), toUInt32(3), toUInt32(7))); ---- Large -select bitmapToArray(bitmapRange(bitmapBuild([ +select bitmapToArray(bitmapSubsetInRange(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]), toUInt32(0), toUInt32(100))); -select bitmapToArray(bitmapRange(bitmapBuild([ +select bitmapToArray(bitmapSubsetInRange(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]), toUInt32(30), toUInt32(200))); -select bitmapToArray(bitmapRange(bitmapBuild([ +select bitmapToArray(bitmapSubsetInRange(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]), toUInt32(100), toUInt32(200))); diff --git a/docs/en/query_language/functions/bitmap_functions.md b/docs/en/query_language/functions/bitmap_functions.md index 60fc7bb15f6..b0d21500035 100644 --- a/docs/en/query_language/functions/bitmap_functions.md +++ b/docs/en/query_language/functions/bitmap_functions.md @@ -56,12 +56,12 @@ SELECT bitmapToArray(bitmapBuild([1, 2, 3, 4, 5])) AS res └─────────────┘ ``` -## bitmapRange {#bitmap_functions-bitmaprange} +## bitmapSubsetInRange {#bitmap_functions-bitmapsubsetinrange} -Return new set with specified range (not include the range_end). +Return subset in specified range (not include the range_end). ``` -bitmapRange(bitmap, range_start, range_end) +bitmapSubsetInRange(bitmap, range_start, range_end) ``` **Parameters** @@ -73,7 +73,7 @@ bitmapRange(bitmap, range_start, range_end) **Example** ``` sql -SELECT bitmapToArray(bitmapRange(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]), toUInt32(30), toUInt32(200))) AS res +SELECT bitmapToArray(bitmapSubsetInRange(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]), toUInt32(30), toUInt32(200))) AS res ``` ``` diff --git a/docs/zh/query_language/functions/bitmap_functions.md b/docs/zh/query_language/functions/bitmap_functions.md index 950c64208db..97be4f38853 100644 --- a/docs/zh/query_language/functions/bitmap_functions.md +++ b/docs/zh/query_language/functions/bitmap_functions.md @@ -51,12 +51,12 @@ SELECT bitmapToArray(bitmapBuild([1, 2, 3, 4, 5])) AS res └─────────────┘ ``` -## bitmapRange +## bitmapSubsetInRange 将位图指定范围(不包含range_end)转换为另一个位图。 ``` -bitmapRange(bitmap, range_start, range_end) +bitmapSubsetInRange(bitmap, range_start, range_end) ``` **参数** @@ -68,7 +68,7 @@ bitmapRange(bitmap, range_start, range_end) **示例** ``` sql -SELECT bitmapToArray(bitmapRange(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]), toUInt32(30), toUInt32(200))) AS res +SELECT bitmapToArray(bitmapSubsetInRange(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]), toUInt32(30), toUInt32(200))) AS res ``` ```