aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Analyzer/Passes/OptimizeGroupByFunctionKeysPass.h
blob: 632960c45bbb12dce8821f69da6ec9ea80055e4c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <Analyzer/IQueryTreePass.h>

namespace DB
{

/* Eliminates functions of other keys in GROUP BY section.
 * Ex.:    GROUP BY x, f(x)
 * Output: GROUP BY x
 */
class OptimizeGroupByFunctionKeysPass final : public IQueryTreePass
{
public:
    String getName() override { return "OptimizeGroupByFunctionKeys"; }

    String getDescription() override { return "Eliminates functions of other keys in GROUP BY section."; }

    void run(QueryTreeNodePtr query_tree_node, ContextPtr context) override;
};

}