ClickHouse/dbms/include/DB/DataStreams/PartialSortingBlockInputStream.h
2012-10-20 02:10:47 +00:00

36 lines
909 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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;
};
}