提交 9cb1d09c 编写于 作者: C Constantin S. Pan

Update the docs

上级 59e7af69
......@@ -40,7 +40,7 @@ SELECT uniq(UserID) FROM table
SELECT uniqMerge(state) FROM (SELECT uniqState(UserID) AS state FROM table GROUP BY RegionID)
```
There is an ` AggregatingMergeTree` engine. Its job during a merge is to combine the states of aggregate functions from different table rows with the same primary key value.
There is an `AggregatingMergeTree` engine. Its job during a merge is to combine the states of aggregate functions from different table rows with the same primary key value.
You can't use a normal INSERT to insert a row in a table containing `AggregateFunction` columns, because you can't explicitly define the `AggregateFunction` value. Instead, use `INSERT SELECT` with `-State` aggregate functions for inserting data.
......
......@@ -16,7 +16,7 @@ The columns to total are set explicitly (the last parameter – Shows, Clicks, C
If the values were null in all of these columns, the row is deleted. (The exception is cases when the data part would not have any rows left in it.)
For the other rows that are not part of the primary key, the first value that occurs is selected when merging.
For the other columns that are not part of the primary key, the first value that occurs is selected when merging. But if a column is of AggregateFunction type, then it is merged according to that function, which effectively makes this engine behave like `AggregatingMergeTree`.
Summation is not performed for a read operation. If it is necessary, write the appropriate GROUP BY.
......
......@@ -16,7 +16,7 @@ SummingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192, (Shows, C
Если значения во всех таких столбцах оказались нулевыми, то строчка удаляется. (За исключением случаев, когда в куске данных не осталось бы ни одной строчки.)
Для остальных столбцов, не входящих в первичный ключ, при слиянии выбирается первое попавшееся значение.
Для остальных столбцов, не входящих в первичный ключ, при слиянии выбирается первое попавшееся значение. Но для столбцов типа AggregateFunction выполняется агрегация согласно заданной функции, так что этот движок фактически ведёт себя как `AggregatinMergeTree`.
При чтении, суммирование не делается само по себе. Если оно необходимо - напишите соответствующий GROUP BY.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册