mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 10:31:57 +00:00
revise the comments
This commit is contained in:
parent
784cab638a
commit
206e1c87e0
@ -10,12 +10,12 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
/** Rewrite the following AST to break the function `sum(column + literal)` into two individual functions
|
||||
/** Rewrite the following Analyzer to break the function `sum(column +/- literal)` into two individual functions
|
||||
* `sum(column)` and `literal * count(column)`.
|
||||
* sum(column + literal) -> sum(column) + literal * count(column)
|
||||
* sum(literal + column) -> sum(column) + literal * count(column)
|
||||
* sum(column - literal) -> sum(column) - literal * count(column)
|
||||
* sum(literal - column) -> sum(column) - literal * count(column)
|
||||
* sum(column + literal) -> sum(column) + literal * count(column)
|
||||
* sum(literal + column) -> literal * count(column) + sum(column)
|
||||
* sum(column - literal) -> sum(column) - literal * count(column)
|
||||
* sum(literal - column) -> literal * count(column) - sum(column)
|
||||
*/
|
||||
|
||||
namespace
|
||||
|
@ -13,12 +13,12 @@ void RewriteSumFunctionWithSumAndCountMatcher::visit(ASTPtr & ast, const Data &
|
||||
visit(*func, ast, data);
|
||||
}
|
||||
|
||||
/** Rewrite the following AST to break the function `sum(column + literal)` into two individual functions
|
||||
/** Rewrite the following AST to break the function `sum(column +/- literal)` into two individual functions
|
||||
* `sum(column)` and `literal * count(column)`.
|
||||
* sum(column + literal) -> sum(column) + literal * count(column)
|
||||
* sum(literal + column) -> sum(column) + literal * count(column)
|
||||
* sum(column - literal) -> sum(column) - literal * count(column)
|
||||
* sum(literal - column) -> sum(column) - literal * count(column)
|
||||
* sum(column + literal) -> sum(column) + literal * count(column)
|
||||
* sum(literal + column) -> literal * count(column) + sum(column)
|
||||
* sum(column - literal) -> sum(column) - literal * count(column)
|
||||
* sum(literal - column) -> literal * count(column) - sum(column)
|
||||
*/
|
||||
void RewriteSumFunctionWithSumAndCountMatcher::visit(const ASTFunction & function, ASTPtr & ast, const Data & data)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user