From 22616d125d1e4345ca8cd59cc5bb2f84f4ab7caf Mon Sep 17 00:00:00 2001 From: TengJianPing <18241664+jacktengg@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:18:31 +0800 Subject: [PATCH] [function](bitmap) add function alias bitmap_andnot and bitmap_andnot_count (#24771) --- be/src/vec/functions/function_bitmap.cpp | 7 +- be/test/vec/function/function_bitmap_test.cpp | 15 ++++ .../bitmap-functions/bitmap-and-not-count.md | 6 +- .../bitmap-functions/bitmap-and-not.md | 6 +- .../bitmap-functions/bitmap-and-not-count.md | 6 +- .../bitmap-functions/bitmap-and-not.md | 6 +- .../doris/catalog/BuiltinScalarFunctions.java | 4 + .../functions/scalar/BitmapAndNotAlias.java | 68 +++++++++++++++++ .../scalar/BitmapAndNotCountAlias.java | 73 +++++++++++++++++++ .../visitor/ScalarFunctionVisitor.java | 10 +++ gensrc/script/doris_builtins_functions.py | 4 +- .../nereids_function_p0/scalar_function/B.out | 58 +++++++++++++++ .../bitmap_functions/test_bitmap_function.out | 9 +++ .../scalar_function/B.groovy | 6 ++ .../test_bitmap_function.groovy | 10 +++ 15 files changed, 272 insertions(+), 16 deletions(-) create mode 100644 fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/BitmapAndNotAlias.java create mode 100644 fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/BitmapAndNotCountAlias.java diff --git a/be/src/vec/functions/function_bitmap.cpp b/be/src/vec/functions/function_bitmap.cpp index 038741c394..7f90db70ab 100644 --- a/be/src/vec/functions/function_bitmap.cpp +++ b/be/src/vec/functions/function_bitmap.cpp @@ -724,13 +724,14 @@ Status execute_bitmap_op_count_null_to_zero( return Status::OK(); } +template class FunctionBitmapAndNotCount : public IFunction { public: using LeftDataType = DataTypeBitMap; using RightDataType = DataTypeBitMap; using ResultDataType = typename BitmapAndNotCount::ResultDataType; - static constexpr auto name = "bitmap_and_not_count"; + static constexpr auto name = FunctionName::name; static FunctionPtr create() { return std::make_shared(); } String get_name() const override { return name; } size_t get_number_of_arguments() const override { return 2; } @@ -1297,7 +1298,9 @@ void register_function_bitmap(SimpleFunctionFactory& factory) { factory.register_function(); factory.register_function(); factory.register_function(); - factory.register_function(); + factory.register_alias(NameBitmapAndNot::name, "bitmap_andnot"); + factory.register_function>(); + factory.register_alias(NameBitmapAndNotCount::name, "bitmap_andnot_count"); factory.register_function(); factory.register_function(); factory.register_function(); diff --git a/be/test/vec/function/function_bitmap_test.cpp b/be/test/vec/function/function_bitmap_test.cpp index 75bbe32527..ba286bf5ac 100644 --- a/be/test/vec/function/function_bitmap_test.cpp +++ b/be/test/vec/function/function_bitmap_test.cpp @@ -430,6 +430,21 @@ TEST(function_bitmap_test, function_bitmap_and_not_count) { check_function(func_name, input_types, data_set); } +TEST(function_bitmap_test, function_bitmap_and_not_count_alias) { + std::string func_name = "bitmap_andnot_count"; + InputTypeSet input_types = {TypeIndex::BitMap, TypeIndex::BitMap}; + BitmapValue bitmap1({1, 2, 3}); + BitmapValue bitmap2({3, 4, std::numeric_limits::min()}); + BitmapValue bitmap3({33, 5, std::numeric_limits::max()}); + BitmapValue empty_bitmap; + + DataSet data_set = {{{&bitmap1, &empty_bitmap}, (int64_t)3}, //1,2,3 + {{&bitmap2, Null()}, (int64_t)0}, + {{&bitmap2, &bitmap3}, (int64_t)3}, //0,3,4 + {{&bitmap1, &bitmap2}, (int64_t)2}}; //1,2 + + check_function(func_name, input_types, data_set); +} TEST(function_bitmap_test, function_bitmap_has_all) { std::string func_name = "bitmap_has_all"; InputTypeSet input_types = {TypeIndex::BitMap, TypeIndex::BitMap}; diff --git a/docs/en/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not-count.md b/docs/en/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not-count.md index 68462547f1..11695a9e4e 100644 --- a/docs/en/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not-count.md +++ b/docs/en/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not-count.md @@ -1,6 +1,6 @@ --- { - "title": "BITMAP_AND_NOT_COUNT", + "title": "BITMAP_AND_NOT_COUNT,BITMAP_ANDNOT_COUNT", "language": "en" } --- @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -## bitmap_and_not_count +## bitmap_and_not_count,bitmap_andnot_count ### description #### Syntax @@ -46,4 +46,4 @@ mysql> select bitmap_and_not_count(bitmap_from_string('1,2,3'),bitmap_from_strin ### keywords - BITMAP_AND_NOT_COUNT,BITMAP + BITMAP_AND_NOT_COUNT,BITMAP_ANDNOT_COUNT,BITMAP diff --git a/docs/en/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not.md b/docs/en/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not.md index c3f87b9e82..beee61656d 100644 --- a/docs/en/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not.md +++ b/docs/en/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not.md @@ -1,6 +1,6 @@ --- { - "title": "BITMAP_AND_NOT", + "title": "BITMAP_AND_NOT,BITMAP_ANDNOT", "language": "en" } --- @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -## bitmap_and_not +## bitmap_and_not,bitmap_andnot ### description #### Syntax @@ -66,4 +66,4 @@ mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),NULL)) ### keywords - BITMAP_AND_NOT,BITMAP + BITMAP_AND_NOT,BITMAP_ANDNOT,BITMAP diff --git a/docs/zh-CN/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not-count.md b/docs/zh-CN/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not-count.md index 63cb74ca8b..3304b48ac2 100644 --- a/docs/zh-CN/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not-count.md +++ b/docs/zh-CN/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not-count.md @@ -1,6 +1,6 @@ --- { - "title": "BITMAP_AND_NOT_COUNT", + "title": "BITMAP_AND_NOT_COUNT,BITMAP_ANDNOT_COUNT", "language": "zh-CN" } --- @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -## bitmap_and_not_count +## bitmap_and_not_count,bitmap_andnot_count ### description #### Syntax @@ -45,4 +45,4 @@ mysql> select bitmap_and_not_count(bitmap_from_string('1,2,3'),bitmap_from_strin ### keywords - BITMAP_AND_NOT_COUNT,BITMAP + BITMAP_AND_NOT_COUNT,BITMAP_ANDNOT_COUNT,BITMAP diff --git a/docs/zh-CN/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not.md b/docs/zh-CN/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not.md index 1a921fb183..9011da5852 100644 --- a/docs/zh-CN/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not.md +++ b/docs/zh-CN/docs/sql-manual/sql-functions/bitmap-functions/bitmap-and-not.md @@ -1,6 +1,6 @@ --- { - "title": "BITMAP_AND_NOT", + "title": "BITMAP_AND_NOT,BITMAP_ANDNOT", "language": "zh-CN" } --- @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -## bitmap_and_not +## bitmap_and_not,bitmap_andnot ### description #### Syntax @@ -67,4 +67,4 @@ mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),NULL)) ### keywords - BITMAP_AND_NOT,BITMAP + BITMAP_AND_NOT,BITMAP_ANDNOT,BITMAP diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java index 6608fd8ea2..e7d583bd04 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java @@ -67,7 +67,9 @@ import org.apache.doris.nereids.trees.expressions.functions.scalar.BitLength; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAnd; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndCount; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNot; +import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNotAlias; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNotCount; +import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNotCountAlias; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapContains; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapCount; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapEmpty; @@ -446,7 +448,9 @@ public class BuiltinScalarFunctions implements FunctionHelper { scalar(BitmapAnd.class, "bitmap_and"), scalar(BitmapAndCount.class, "bitmap_and_count"), scalar(BitmapAndNot.class, "bitmap_and_not"), + scalar(BitmapAndNotAlias.class, "bitmap_andnot"), scalar(BitmapAndNotCount.class, "bitmap_and_not_count"), + scalar(BitmapAndNotCountAlias.class, "bitmap_andnot_count"), scalar(BitmapContains.class, "bitmap_contains"), scalar(BitmapCount.class, "bitmap_count"), scalar(BitmapEmpty.class, "bitmap_empty"), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/BitmapAndNotAlias.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/BitmapAndNotAlias.java new file mode 100644 index 0000000000..08cd20e199 --- /dev/null +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/BitmapAndNotAlias.java @@ -0,0 +1,68 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.nereids.trees.expressions.functions.scalar; + +import org.apache.doris.catalog.FunctionSignature; +import org.apache.doris.nereids.trees.expressions.Expression; +import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature; +import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable; +import org.apache.doris.nereids.trees.expressions.shape.BinaryExpression; +import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.BitmapType; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; + +import java.util.List; + +/** + * ScalarFunction 'bitmap_and_not'. This class is generated by GenerateFunction. + */ +public class BitmapAndNotAlias extends ScalarFunction + implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullable { + + public static final List SIGNATURES = ImmutableList.of( + FunctionSignature.ret(BitmapType.INSTANCE).args(BitmapType.INSTANCE, BitmapType.INSTANCE) + ); + + /** + * constructor with 2 arguments. + */ + public BitmapAndNotAlias(Expression arg0, Expression arg1) { + super("bitmap_andnot", arg0, arg1); + } + + /** + * withChildren. + */ + @Override + public BitmapAndNotAlias withChildren(List children) { + Preconditions.checkArgument(children.size() == 2); + return new BitmapAndNotAlias(children.get(0), children.get(1)); + } + + @Override + public List getSignatures() { + return SIGNATURES; + } + + @Override + public R accept(ExpressionVisitor visitor, C context) { + return visitor.visitBitmapAndNotAlias(this, context); + } +} diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/BitmapAndNotCountAlias.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/BitmapAndNotCountAlias.java new file mode 100644 index 0000000000..f71bc2cbe6 --- /dev/null +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/BitmapAndNotCountAlias.java @@ -0,0 +1,73 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.nereids.trees.expressions.functions.scalar; + +import org.apache.doris.catalog.FunctionSignature; +import org.apache.doris.nereids.trees.expressions.Expression; +import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature; +import org.apache.doris.nereids.trees.expressions.shape.BinaryExpression; +import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.BigIntType; +import org.apache.doris.nereids.types.BitmapType; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; + +import java.util.List; + +/** + * ScalarFunction 'bitmap_and_not_count'. This class is generated by GenerateFunction. + */ +public class BitmapAndNotCountAlias extends ScalarFunction + implements BinaryExpression, ExplicitlyCastableSignature { + + public static final List SIGNATURES = ImmutableList.of( + FunctionSignature.ret(BigIntType.INSTANCE).args(BitmapType.INSTANCE, BitmapType.INSTANCE) + ); + + /** + * constructor with 2 arguments. + */ + public BitmapAndNotCountAlias(Expression arg0, Expression arg1) { + super("bitmap_andnot_count", arg0, arg1); + } + + /** + * withChildren. + */ + @Override + public BitmapAndNotCountAlias withChildren(List children) { + Preconditions.checkArgument(children.size() == 2); + return new BitmapAndNotCountAlias(children.get(0), children.get(1)); + } + + @Override + public List getSignatures() { + return SIGNATURES; + } + + @Override + public R accept(ExpressionVisitor visitor, C context) { + return visitor.visitBitmapAndNotCountAlias(this, context); + } + + @Override + public boolean nullable() { + return children().stream().anyMatch(Expression::nullable); + } +} diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.java index b0dde6aff2..894c576366 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.java @@ -69,7 +69,9 @@ import org.apache.doris.nereids.trees.expressions.functions.scalar.BitLength; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAnd; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndCount; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNot; +import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNotAlias; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNotCount; +import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapAndNotCountAlias; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapContains; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapCount; import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapEmpty; @@ -580,6 +582,14 @@ public interface ScalarFunctionVisitor { return visitScalarFunction(bitmapAndNotCount, context); } + default R visitBitmapAndNotAlias(BitmapAndNotAlias bitmapAndNotAlias, C context) { + return visitScalarFunction(bitmapAndNotAlias, context); + } + + default R visitBitmapAndNotCountAlias(BitmapAndNotCountAlias bitmapAndNotCountAlias, C context) { + return visitScalarFunction(bitmapAndNotCountAlias, context); + } + default R visitBitmapContains(BitmapContains bitmapContains, C context) { return visitScalarFunction(bitmapContains, context); } diff --git a/gensrc/script/doris_builtins_functions.py b/gensrc/script/doris_builtins_functions.py index e6e5192f3a..e9294ae977 100644 --- a/gensrc/script/doris_builtins_functions.py +++ b/gensrc/script/doris_builtins_functions.py @@ -1834,7 +1834,7 @@ visible_functions = { [['bitmap_hash'], 'BITMAP', ['STRING'], 'ALWAYS_NOT_NULLABLE'], [['bitmap_hash64'], 'BITMAP', ['STRING'], 'ALWAYS_NOT_NULLABLE'], [['bitmap_count'], 'BIGINT', ['BITMAP'], 'ALWAYS_NOT_NULLABLE'], - [['bitmap_and_not_count'], 'BIGINT', ['BITMAP','BITMAP'], ''], + [['bitmap_and_not_count', 'bitmap_andnot_count'], 'BIGINT', ['BITMAP','BITMAP'], ''], [['bitmap_empty'], 'BITMAP', [], 'ALWAYS_NOT_NULLABLE'], [['bitmap_or'], 'BITMAP', ['BITMAP','BITMAP','...'], ''], [['bitmap_or'], 'BITMAP', ['BITMAP','BITMAP'], ''], @@ -1845,7 +1845,7 @@ visible_functions = { [['bitmap_not'], 'BITMAP', ['BITMAP','BITMAP'], ''], [['bitmap_and'], 'BITMAP', ['BITMAP','BITMAP','...'], ''], [['bitmap_and'], 'BITMAP', ['BITMAP','BITMAP'], ''], - [['bitmap_and_not'], 'BITMAP', ['BITMAP','BITMAP'], ''], + [['bitmap_and_not', 'bitmap_andnot'], 'BITMAP', ['BITMAP','BITMAP'], ''], [['bitmap_to_string'], 'STRING', ['BITMAP'], ''], [['bitmap_from_string'], 'BITMAP', ['VARCHAR'], 'ALWAYS_NULLABLE'], [['bitmap_from_string'], 'BITMAP', ['STRING'], 'ALWAYS_NULLABLE'], diff --git a/regression-test/data/nereids_function_p0/scalar_function/B.out b/regression-test/data/nereids_function_p0/scalar_function/B.out index 04a79b36a7..a896096e16 100644 --- a/regression-test/data/nereids_function_p0/scalar_function/B.out +++ b/regression-test/data/nereids_function_p0/scalar_function/B.out @@ -202,6 +202,64 @@ 0 0 +-- !sql_bitmap_andnot_Bitmap_Bitmap -- +\N +\N +\N +\N +\N +\N +\N +\N +\N +\N +\N +\N +\N + +-- !sql_bitmap_andnot_Bitmap_Bitmap_notnull -- +\N +\N +\N +\N +\N +\N +\N +\N +\N +\N +\N +\N + +-- !sql_bitmap_andnot_count_Bitmap_Bitmap -- +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 + +-- !sql_bitmap_andnot_count_Bitmap_Bitmap_notnull -- +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 + -- !sql_bitmap_contains_Bitmap_BigInt -- \N true diff --git a/regression-test/data/query_p0/sql_functions/bitmap_functions/test_bitmap_function.out b/regression-test/data/query_p0/sql_functions/bitmap_functions/test_bitmap_function.out index d6ffc0d621..8afca0f983 100644 --- a/regression-test/data/query_p0/sql_functions/bitmap_functions/test_bitmap_function.out +++ b/regression-test/data/query_p0/sql_functions/bitmap_functions/test_bitmap_function.out @@ -273,6 +273,12 @@ true 3 0 4 0 +-- !sql_bitmap_andnot_count3 -- +1 1 +2 1 +3 0 +4 0 + -- !sql_bitmap_and_count8 -- 1 2 2 2 @@ -336,6 +342,9 @@ true -- !sql -- 2 +-- !sql_bitmap_andnot -- +2 + -- !sql_bitmap_and_not_count1 -- 2 diff --git a/regression-test/suites/nereids_function_p0/scalar_function/B.groovy b/regression-test/suites/nereids_function_p0/scalar_function/B.groovy index bedb440b1c..b07e2647f0 100644 --- a/regression-test/suites/nereids_function_p0/scalar_function/B.groovy +++ b/regression-test/suites/nereids_function_p0/scalar_function/B.groovy @@ -33,6 +33,12 @@ suite("nereids_scalar_fn_B") { qt_sql_bitmap_and_not_Bitmap_Bitmap_notnull "select bitmap_and_not(to_bitmap(kbint), to_bitmap(kbint)) from fn_test_not_nullable order by kbint, kbint" qt_sql_bitmap_and_not_count_Bitmap_Bitmap "select bitmap_and_not_count(to_bitmap(kbint), to_bitmap(kbint)) from fn_test order by kbint, kbint" qt_sql_bitmap_and_not_count_Bitmap_Bitmap_notnull "select bitmap_and_not_count(to_bitmap(kbint), to_bitmap(kbint)) from fn_test_not_nullable order by kbint, kbint" + + qt_sql_bitmap_andnot_Bitmap_Bitmap "select bitmap_andnot(to_bitmap(kbint), to_bitmap(kbint)) from fn_test order by kbint, kbint" + qt_sql_bitmap_andnot_Bitmap_Bitmap_notnull "select bitmap_andnot(to_bitmap(kbint), to_bitmap(kbint)) from fn_test_not_nullable order by kbint, kbint" + qt_sql_bitmap_andnot_count_Bitmap_Bitmap "select bitmap_andnot_count(to_bitmap(kbint), to_bitmap(kbint)) from fn_test order by kbint, kbint" + qt_sql_bitmap_andnot_count_Bitmap_Bitmap_notnull "select bitmap_andnot_count(to_bitmap(kbint), to_bitmap(kbint)) from fn_test_not_nullable order by kbint, kbint" + qt_sql_bitmap_contains_Bitmap_BigInt "select bitmap_contains(to_bitmap(kbint), kbint) from fn_test order by kbint, kbint" qt_sql_bitmap_contains_Bitmap_BigInt_notnull "select bitmap_contains(to_bitmap(kbint), kbint) from fn_test_not_nullable order by kbint, kbint" qt_sql_bitmap_count_Bitmap "select bitmap_count(to_bitmap(kbint)) from fn_test order by kbint" diff --git a/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy b/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy index 709d289721..36e36d6762 100644 --- a/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy +++ b/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy @@ -386,6 +386,15 @@ suite("test_bitmap_function") { on l.dt = r.dt order by l.dt, count """ + qt_sql_bitmap_andnot_count3 """ + select + l.dt, + bitmap_andnot_count(l.id, r.id) count + from + test_bitmap1 l left join test_bitmap2 r + on l.dt = r.dt + order by l.dt, count + """ qt_sql_bitmap_and_count8 """ select l.dt, @@ -519,6 +528,7 @@ suite("test_bitmap_function") { // BITMAP_AND_NOT qt_sql """ select bitmap_count(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5'))) cnt """ + qt_sql_bitmap_andnot """ select bitmap_count(bitmap_andnot(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5'))) cnt """ // BITMAP_AND_NOT_COUNT qt_sql_bitmap_and_not_count1 """ select bitmap_and_not_count(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')) cnt """