ClickHouse/dbms/include/DB/DataStreams/PartialSortingBlockInputStream.h
2011-10-24 12:10:59 +00:00

35 lines
898 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);
}
Block readImpl();
String getName() const { return "PartialSortingBlockInputStream"; }
BlockInputStreamPtr clone() { return new PartialSortingBlockInputStream(input, description); }
private:
BlockInputStreamPtr input;
SortDescription description;
};
}