diff --git a/docs/en/table_engines/aggregatingmergetree.md b/docs/en/table_engines/aggregatingmergetree.md index 987c102508be911d746fc844da65f878c4515fc3..ec14eb6613098b5cf5cf64d4e75a2eaa8e21647f 100644 --- a/docs/en/table_engines/aggregatingmergetree.md +++ b/docs/en/table_engines/aggregatingmergetree.md @@ -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. diff --git a/docs/en/table_engines/summingmergetree.md b/docs/en/table_engines/summingmergetree.md index 19f690ef9c1145feceb0fafa412c0d896e985589..0d6c9752efd74c89b613b75d8ce764c005643f46 100644 --- a/docs/en/table_engines/summingmergetree.md +++ b/docs/en/table_engines/summingmergetree.md @@ -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. diff --git a/docs/ru/table_engines/summingmergetree.md b/docs/ru/table_engines/summingmergetree.md index da49ae0b2570c122d715eb8f1edae880faa03e30..ce4995b21a766a1d80a1321dea2b819735f3f45c 100644 --- a/docs/ru/table_engines/summingmergetree.md +++ b/docs/ru/table_engines/summingmergetree.md @@ -16,7 +16,7 @@ SummingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192, (Shows, C Если значения во всех таких столбцах оказались нулевыми, то строчка удаляется. (За исключением случаев, когда в куске данных не осталось бы ни одной строчки.) -Для остальных столбцов, не входящих в первичный ключ, при слиянии выбирается первое попавшееся значение. +Для остальных столбцов, не входящих в первичный ключ, при слиянии выбирается первое попавшееся значение. Но для столбцов типа AggregateFunction выполняется агрегация согласно заданной функции, так что этот движок фактически ведёт себя как `AggregatinMergeTree`. При чтении, суммирование не делается само по себе. Если оно необходимо - напишите соответствующий GROUP BY.