If they are defined, they can override table-level settings.
{
            Block aggregates;
            /
            for (const auto & aggregate : select.getQueryAnalyzer()->aggregates())
            {
                if (const auto * column = sample_block.findByName(aggregate.column_name))
                {
                    aggregates.insert(*column);
                    continue;
                }
                /
                if (minmax_count_projection && dynamic_cast<const AggregateFunctionCount *>(aggregate.function.get()))
                {
                    const auto * count_column = sample_block.findByName("count()");
                    if (!count_column)
                        throw Exception(
                            ErrorCodes::LOGICAL_ERROR, "`count()` column is missing when minmax_count_projection == true. It is a bug");
                    aggregates.insert({count_column->column, count_column->type, aggregate.column_name});
                    continue;
                }
                /
                return;
            }
            /
            /
            /
            /
            candidate.before_aggregation = analysis_result.before_aggregation->clone();
            auto required_columns = candidate.before_aggregation->foldActionsByProjection(keys, sample_block_for_keys);
            /