mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-16 20:53:27 +00:00
36 lines
909 B
C++
36 lines
909 B
C++
#pragma once
|
||
|
||
#include <DB/Core/SortDescription.h>
|
||
|
||
#include <DB/DataStreams/IProfilingBlockInputStream.h>
|
||
|
||
|
||
namespace DB
|
||
{
|
||
|
||
/** Сортирует каждый блок по отдельности по значениям указанных столбцов.
|
||
* На данный момент, используется не очень оптимальный алгоритм.
|
||
*/
|
||
class PartialSortingBlockInputStream : public IProfilingBlockInputStream
|
||
{
|
||
public:
|
||
PartialSortingBlockInputStream(BlockInputStreamPtr input_, SortDescription & description_)
|
||
: input(input_), description(description_)
|
||
{
|
||
children.push_back(input);
|
||
}
|
||
|
||
String getName() const { return "PartialSortingBlockInputStream"; }
|
||
|
||
BlockInputStreamPtr clone() { return new PartialSortingBlockInputStream(input, description); }
|
||
|
||
protected:
|
||
Block readImpl();
|
||
|
||
private:
|
||
BlockInputStreamPtr input;
|
||
SortDescription description;
|
||
};
|
||
|
||
}
|