ClickHouse/dbms/include/DB/DataStreams/PartialSortingBlockInputStream.h

35 lines
898 B
C
Raw Normal View History

2011-09-04 00:22:19 +00:00
#pragma once
2011-09-04 01:42:14 +00:00
#include <DB/Core/SortDescription.h>
2011-09-04 00:22:19 +00:00
2011-09-04 21:23:19 +00:00
#include <DB/DataStreams/IProfilingBlockInputStream.h>
2011-09-04 00:22:19 +00:00
namespace DB
{
/** Сортирует каждый блок по отдельности по значениям указанных столбцов.
2011-09-04 01:42:14 +00:00
* На данный момент, используется не очень оптимальный алгоритм.
2011-09-04 00:22:19 +00:00
*/
2011-09-04 21:23:19 +00:00
class PartialSortingBlockInputStream : public IProfilingBlockInputStream
2011-09-04 00:22:19 +00:00
{
public:
2011-09-04 01:42:14 +00:00
PartialSortingBlockInputStream(BlockInputStreamPtr input_, SortDescription & description_)
2011-09-04 21:23:19 +00:00
: input(input_), description(description_)
{
children.push_back(input);
}
2011-09-04 00:22:19 +00:00
2011-09-04 21:23:19 +00:00
Block readImpl();
String getName() const { return "PartialSortingBlockInputStream"; }
2011-09-04 00:22:19 +00:00
2011-10-24 12:10:59 +00:00
BlockInputStreamPtr clone() { return new PartialSortingBlockInputStream(input, description); }
2011-09-04 00:22:19 +00:00
private:
BlockInputStreamPtr input;
2011-09-04 01:42:14 +00:00
SortDescription description;
2011-09-04 00:22:19 +00:00
};
}