| 202 | } |
| 203 | |
| 204 | void TTLAggregationAlgorithm::finalizeAggregates(MutableColumns & result_columns) |
| 205 | { |
| 206 | if (!aggregation_result.empty()) |
| 207 | { |
| 208 | auto aggregated_res = aggregator->convertToBlocks(aggregation_result, true, 1); |
| 209 | |
| 210 | for (auto & agg_block : aggregated_res) |
| 211 | { |
| 212 | for (const auto & it : description.set_parts) |
| 213 | it.expression->execute(agg_block); |
| 214 | |
| 215 | for (const auto & name : description.group_by_keys) |
| 216 | { |
| 217 | const IColumn * values_column = agg_block.getByName(name).column.get(); |
| 218 | auto & result_column = result_columns[header.getPositionByName(name)]; |
| 219 | result_column->insertRangeFrom(*values_column, 0, agg_block.rows()); |
| 220 | } |
| 221 | |
| 222 | for (const auto & it : description.set_parts) |
| 223 | { |
| 224 | const IColumn * values_column = agg_block.getByName(it.expression_result_column_name).column.get(); |
| 225 | auto & result_column = result_columns[header.getPositionByName(it.column_name)]; |
| 226 | result_column->insertRangeFrom(*values_column, 0, agg_block.rows()); |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | aggregation_result.invalidate(); |
| 232 | } |
| 233 | |
| 234 | void TTLAggregationAlgorithm::finalize(const MutableDataPartPtr & data_part) const |
| 235 | { |
nothing calls this directly
no test coverage detected