From 9fdae29421410d61a0df9bf6f7ec9f194033752c Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Tue, 20 Jul 2021 20:51:23 +0800 Subject: [PATCH] Fix groupBitmapAnd/Or/Xor name --- src/AggregateFunctions/AggregateFunctionGroupBitmap.h | 5 ++++- .../0_stateless/01948_group_bitmap_and_or_xor_fix.reference | 1 + .../0_stateless/01948_group_bitmap_and_or_xor_fix.sql | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tests/queries/0_stateless/01948_group_bitmap_and_or_xor_fix.reference create mode 100644 tests/queries/0_stateless/01948_group_bitmap_and_or_xor_fix.sql diff --git a/src/AggregateFunctions/AggregateFunctionGroupBitmap.h b/src/AggregateFunctions/AggregateFunctionGroupBitmap.h index e5097211928..3faeb781284 100644 --- a/src/AggregateFunctions/AggregateFunctionGroupBitmap.h +++ b/src/AggregateFunctions/AggregateFunctionGroupBitmap.h @@ -60,7 +60,7 @@ public: { } - String getName() const override { return Data::name(); } + String getName() const override { return Policy::name; } DataTypePtr getReturnType() const override { return std::make_shared>(); } @@ -120,6 +120,7 @@ template class BitmapAndPolicy { public: + static constexpr auto name = "groupBitmapAnd"; static void apply(Data & lhs, const Data & rhs) { lhs.rbs.rb_and(rhs.rbs); } }; @@ -127,6 +128,7 @@ template class BitmapOrPolicy { public: + static constexpr auto name = "groupBitmapOr"; static void apply(Data & lhs, const Data & rhs) { lhs.rbs.rb_or(rhs.rbs); } }; @@ -134,6 +136,7 @@ template class BitmapXorPolicy { public: + static constexpr auto name = "groupBitmapXor"; static void apply(Data & lhs, const Data & rhs) { lhs.rbs.rb_xor(rhs.rbs); } }; diff --git a/tests/queries/0_stateless/01948_group_bitmap_and_or_xor_fix.reference b/tests/queries/0_stateless/01948_group_bitmap_and_or_xor_fix.reference new file mode 100644 index 00000000000..1cec1260860 --- /dev/null +++ b/tests/queries/0_stateless/01948_group_bitmap_and_or_xor_fix.reference @@ -0,0 +1 @@ +1 1 0 diff --git a/tests/queries/0_stateless/01948_group_bitmap_and_or_xor_fix.sql b/tests/queries/0_stateless/01948_group_bitmap_and_or_xor_fix.sql new file mode 100644 index 00000000000..7a7c603ffa5 --- /dev/null +++ b/tests/queries/0_stateless/01948_group_bitmap_and_or_xor_fix.sql @@ -0,0 +1 @@ +SELECT groupBitmapAnd(bitmapBuild([toInt32(1)])), groupBitmapOr(bitmapBuild([toInt32(1)])), groupBitmapXor(bitmapBuild([toInt32(1)])) FROM cluster(test_cluster_two_shards, numbers(10));