2020-04-02 14:33:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Processors/Merges/IMergingTransform.h>
|
2020-04-14 09:21:24 +00:00
|
|
|
#include <Processors/Merges/Algorithms/GraphiteRollupSortedAlgorithm.h>
|
2020-04-02 14:33:30 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
/** Merges several sorted ports into one.
|
|
|
|
*
|
|
|
|
* For each group of consecutive identical values of the `path` column,
|
|
|
|
* and the same `time` values, rounded to some precision
|
|
|
|
* (where rounding accuracy depends on the template set for `path`
|
|
|
|
* and the amount of time elapsed from `time` to the specified time),
|
|
|
|
* keeps one line,
|
|
|
|
* performing the rounding of time,
|
|
|
|
* merge `value` values using the specified aggregate functions,
|
|
|
|
* as well as keeping the maximum value of the `version` column.
|
|
|
|
*/
|
2020-04-14 09:05:29 +00:00
|
|
|
class GraphiteRollupSortedTransform : public IMergingTransform<GraphiteRollupSortedAlgorithm>
|
2020-04-02 14:33:30 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
GraphiteRollupSortedTransform(
|
2020-04-02 16:28:50 +00:00
|
|
|
const Block & header, size_t num_inputs,
|
2020-04-02 14:33:30 +00:00
|
|
|
SortDescription description_, size_t max_block_size,
|
2020-04-10 16:15:51 +00:00
|
|
|
Graphite::Params params_, time_t time_of_merge_)
|
2020-04-14 09:05:29 +00:00
|
|
|
: IMergingTransform(
|
2020-04-10 16:15:51 +00:00
|
|
|
num_inputs, header, header, true,
|
|
|
|
header,
|
|
|
|
num_inputs,
|
|
|
|
std::move(description_),
|
|
|
|
max_block_size,
|
|
|
|
std::move(params_),
|
|
|
|
time_of_merge_)
|
2020-04-02 14:33:30 +00:00
|
|
|
{
|
2020-04-10 16:15:51 +00:00
|
|
|
}
|
2020-04-06 16:57:49 +00:00
|
|
|
|
2020-04-10 16:15:51 +00:00
|
|
|
String getName() const override { return "GraphiteRollupSortedTransform"; }
|
2020-04-02 14:33:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|