MCPcopy Create free account
hub / github.com/ByConity/ByConity / TTLAggregationAlgorithm

Method TTLAggregationAlgorithm

src/DataStreams/TTLAggregationAlgorithm.cpp:28–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26{
27
28TTLAggregationAlgorithm::TTLAggregationAlgorithm(
29 const TTLDescription & description_,
30 const TTLInfo & old_ttl_info_,
31 time_t current_time_,
32 bool force_,
33 const Block & header_,
34 const MergeTreeMetaBase & storage_)
35 : ITTLAlgorithm(description_, old_ttl_info_, current_time_, force_)
36 , header(header_)
37{
38 current_key_value.resize(description.group_by_keys.size());
39
40 ColumnNumbers keys;
41 for (const auto & key : description.group_by_keys)
42 keys.push_back(header.getPositionByName(key));
43
44 key_columns.resize(description.group_by_keys.size());
45 AggregateDescriptions aggregates = description.aggregate_descriptions;
46
47 for (auto & descr : aggregates)
48 if (descr.arguments.empty())
49 for (const auto & name : descr.argument_names)
50 descr.arguments.push_back(header.getPositionByName(name));
51
52 columns_for_aggregator.resize(description.aggregate_descriptions.size());
53 const Settings & settings = storage_.getContext()->getSettingsRef();
54
55 Aggregator::Params params(
56 header,
57 keys,
58 aggregates,
59 false,
60 settings.max_rows_to_group_by,
61 settings.group_by_overflow_mode,
62 0,
63 0,
64 settings.max_bytes_before_external_group_by,
65 settings.spill_mode == SpillMode::AUTO,
66 settings.spill_buffer_bytes_before_external_group_by,
67 settings.empty_result_for_aggregation_by_empty_set,
68 storage_.getContext()->getTemporaryVolume(),
69 settings.max_threads,
70 settings.min_free_disk_space_for_temporary_data,
71 settings.compile_aggregate_expressions,
72 settings.min_count_to_compile_aggregate_expression,
73 {},
74 settings.enable_lc_group_by_opt);
75
76 aggregator = std::make_unique<Aggregator>(params);
77
78 if (isMaxTTLExpired())
79 new_ttl_info.finished = true;
80}
81
82void TTLAggregationAlgorithm::execute(Block & block)
83{

Callers

nothing calls this directly

Calls 7

resizeMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
getPositionByNameMethod · 0.45
emptyMethod · 0.45
getContextMethod · 0.45
getTemporaryVolumeMethod · 0.45

Tested by

no test coverage detected