Skip to content

Commit

Permalink
Merge pull request #26557 from amosbird/groupbitmaporfix
Browse files Browse the repository at this point in the history
Fix wrong name of groupBitmapAnd/Or/Xor.
  • Loading branch information
alexey-milovidov committed Jul 20, 2021
2 parents 7745905 + 9fdae29 commit 0304cf2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/AggregateFunctions/AggregateFunctionGroupBitmap.h
Expand Up @@ -60,7 +60,7 @@ class AggregateFunctionBitmapL2 final : public IAggregateFunctionDataHelper<Data
{
}

String getName() const override { return Data::name(); }
String getName() const override { return Policy::name; }

DataTypePtr getReturnType() const override { return std::make_shared<DataTypeNumber<T>>(); }

Expand Down Expand Up @@ -120,20 +120,23 @@ template <typename Data>
class BitmapAndPolicy
{
public:
static constexpr auto name = "groupBitmapAnd";
static void apply(Data & lhs, const Data & rhs) { lhs.rbs.rb_and(rhs.rbs); }
};

template <typename Data>
class BitmapOrPolicy
{
public:
static constexpr auto name = "groupBitmapOr";
static void apply(Data & lhs, const Data & rhs) { lhs.rbs.rb_or(rhs.rbs); }
};

template <typename Data>
class BitmapXorPolicy
{
public:
static constexpr auto name = "groupBitmapXor";
static void apply(Data & lhs, const Data & rhs) { lhs.rbs.rb_xor(rhs.rbs); }
};

Expand Down
@@ -0,0 +1 @@
1 1 0
@@ -0,0 +1 @@
SELECT groupBitmapAnd(bitmapBuild([toInt32(1)])), groupBitmapOr(bitmapBuild([toInt32(1)])), groupBitmapXor(bitmapBuild([toInt32(1)])) FROM cluster(test_cluster_two_shards, numbers(10));

0 comments on commit 0304cf2

Please sign in to comment.