mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
35 lines
898 B
C++
35 lines
898 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);
|
||
}
|
||
|
||
Block readImpl();
|
||
|
||
String getName() const { return "PartialSortingBlockInputStream"; }
|
||
|
||
BlockInputStreamPtr clone() { return new PartialSortingBlockInputStream(input, description); }
|
||
|
||
private:
|
||
BlockInputStreamPtr input;
|
||
SortDescription description;
|
||
};
|
||
|
||
}
|