mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 02:12:21 +00:00
28 lines
587 B
C++
28 lines
587 B
C++
#pragma once
|
|
#include <Processors/ISimpleTransform.h>
|
|
#include <Common/HashTable/HashMap.h>
|
|
#include <Common/UInt128.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class LimitByTransform : public ISimpleTransform
|
|
{
|
|
public:
|
|
LimitByTransform(const Block & header, size_t group_size_, const Names & columns);
|
|
|
|
String getName() const override { return "LimitByTransform"; }
|
|
|
|
protected:
|
|
void transform(Chunk & chunk) override;
|
|
|
|
private:
|
|
using MapHashed = HashMap<UInt128, UInt64, UInt128TrivialHash>;
|
|
|
|
MapHashed keys_counts;
|
|
std::vector<size_t> key_positions;
|
|
const size_t group_size;
|
|
};
|
|
|
|
}
|