diff --git a/functions-and-operators/aggregate-group-by-functions.md b/functions-and-operators/aggregate-group-by-functions.md
index 317ad2de60a2..293b7941b9e2 100644
--- a/functions-and-operators/aggregate-group-by-functions.md
+++ b/functions-and-operators/aggregate-group-by-functions.md
@@ -1,7 +1,7 @@
---
title: GROUP BY 聚合函数
aliases: ['/docs-cn/dev/functions-and-operators/aggregate-group-by-functions/','/docs-cn/dev/reference/sql/functions-and-operators/aggregate-group-by-functions/']
-summary: TiDB支持的聚合函数包括 COUNT、COUNT(DISTINCT)、SUM、AVG、MAX、MIN、GROUP_CONCAT、VARIANCE、VAR_POP、STD、STDDEV、VAR_SAMP、STDDEV_SAMP 和 JSON_OBJECTAGG。除了 GROUP_CONCAT 和 APPROX_PERCENTILE 外,这些聚合函数可以作为窗口函数使用。另外,TiDB 的 GROUP BY 子句支持 WITH ROLLUP 修饰符,还支持 SQL 模式 ONLY_FULL_GROUP_BY。与 MySQL 的区别在于 TiDB 对标准 SQL 有一些扩展,允许在 HAVING 子句中使用别名和非列表达式。
+summary: TiDB 支持的聚合函数包括 COUNT、COUNT(DISTINCT)、SUM、SUM_INT、AVG、MAX、MIN、GROUP_CONCAT、VARIANCE、VAR_POP、STD、STDDEV、VAR_SAMP、STDDEV_SAMP 和 JSON_OBJECTAGG。除了 GROUP_CONCAT、APPROX_PERCENTILE 和 APPROX_COUNT_DISTINCT 外,这些聚合函数可以作为窗口函数使用。另外,TiDB 的 GROUP BY 子句支持 WITH ROLLUP 修饰符,还支持 SQL 模式 ONLY_FULL_GROUP_BY。与 MySQL 的区别在于 TiDB 对标准 SQL 有一些扩展,允许在 HAVING 子句中使用别名和非列表达式。
---
# GROUP BY 聚合函数
@@ -35,6 +35,53 @@ TiDB 支持的 MySQL `GROUP BY` 聚合函数如下所示:
另外,TiDB 还支持以下聚合函数:
++ `SUM_INT(expr)`
+
+ 该函数用于对整数表达式 `expr` 求和,功能类似于 `SUM(expr)`,但仅接受整数类型参数,包括 `TINYINT`、`SMALLINT`、`MEDIUMINT`、`INT` 和 `BIGINT`。对于有符号整数参数,返回类型为 `BIGINT`;对于无符号整数参数,返回类型为 `BIGINT UNSIGNED`。如果参与计算的非 `NULL` 值之和超出返回类型范围,TiDB 返回整数溢出错误。
+
+ `SUM_INT()` 默认忽略 `NULL` 值。如果没有非 `NULL` 值,返回 `NULL`。`SUM_INT()` 支持 `DISTINCT`,并可作为[窗口函数](/functions-and-operators/window-functions.md)使用。
+
+ 以下是一个使用该函数的示例:
+
+ ```sql
+ DROP TABLE IF EXISTS t;
+ CREATE TABLE t(id INT PRIMARY KEY, a BIGINT, b BIGINT UNSIGNED);
+ INSERT INTO t VALUES(1, 1, 1), (2, 1, 1), (3, 2, 2), (4, NULL, NULL);
+ ```
+
+ ```sql
+ SELECT SUM_INT(a), SUM_INT(DISTINCT a), SUM_INT(b) FROM t;
+ ```
+
+ ```sql
+ +------------+---------------------+------------+
+ | SUM_INT(a) | SUM_INT(DISTINCT a) | SUM_INT(b) |
+ +------------+---------------------+------------+
+ | 4 | 3 | 4 |
+ +------------+---------------------+------------+
+ 1 row in set (0.00 sec)
+ ```
+
+ 以下示例将 `SUM_INT()` 作为窗口函数使用:
+
+ ```sql
+ SELECT id, a, SUM_INT(a) OVER (ORDER BY id ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS rolling_sum
+ FROM t
+ ORDER BY id;
+ ```
+
+ ```sql
+ +----+------+-------------+
+ | id | a | rolling_sum |
+ +----+------+-------------+
+ | 1 | 1 | 1 |
+ | 2 | 1 | 2 |
+ | 3 | 2 | 3 |
+ | 4 | NULL | 2 |
+ +----+------+-------------+
+ 4 rows in set (0.00 sec)
+ ```
+
+ `APPROX_PERCENTILE(expr, constant_integer_expr)`
该函数用于计算 `expr` 值的百分位数。参数 `constant_integer_expr` 是一个取值为区间 `[1,100]` 内整数的常量表达式,表示百分数。一个百分位数 Pk(`k`为百分数)表示数据集中至少有 `k%` 的数据小于等于 Pk。
@@ -88,7 +135,7 @@ TiDB 支持的 MySQL `GROUP BY` 聚合函数如下所示:
2 rows in set (0.00 sec)
```
-上述聚合函数除 `GROUP_CONCAT()`、 `APPROX_PERCENTILE()` 和 `APPROX_COUNT_DISTINCT` 以外,均可作为[窗口函数](/functions-and-operators/window-functions.md)使用。
+上述聚合函数除 `GROUP_CONCAT()`、`APPROX_PERCENTILE()` 和 `APPROX_COUNT_DISTINCT()` 以外,均可作为[窗口函数](/functions-and-operators/window-functions.md)使用。
## GROUP BY 修饰符
diff --git a/functions-and-operators/expressions-pushed-down.md b/functions-and-operators/expressions-pushed-down.md
index 6feb26944616..87b41ccb1872 100644
--- a/functions-and-operators/expressions-pushed-down.md
+++ b/functions-and-operators/expressions-pushed-down.md
@@ -26,7 +26,7 @@ TiFlash 也支持[本页](/tiflash/tiflash-supported-pushdown-calculations.md)
| [JSON 运算](/functions-and-operators/json-functions.md) | [JSON_ARRAY_APPEND()](/functions-and-operators/json-functions/json-functions-modify.md#json_array_append)
[JSON_ARRAY()](/functions-and-operators/json-functions/json-functions-create.md#json_array)
[JSON_CONTAINS()](/functions-and-operators/json-functions/json-functions-search.md#json_contains)
[JSON_EXTRACT()](/functions-and-operators/json-functions/json-functions-search.md#json_extract)
[JSON_INSERT()](/functions-and-operators/json-functions/json-functions-modify.md#json_insert)
[JSON_LENGTH()](/functions-and-operators/json-functions/json-functions-return.md#json_length)
[JSON_MERGE_PATCH()](/functions-and-operators/json-functions/json-functions-modify.md#json_merge_patch)
[JSON_MERGE()](/functions-and-operators/json-functions/json-functions-modify.md#json_merge)
[JSON_OBJECT()](/functions-and-operators/json-functions/json-functions-create.md#json_object)
[JSON_REMOVE()](/functions-and-operators/json-functions/json-functions-modify.md#json_remove)
[JSON_REPLACE()](/functions-and-operators/json-functions/json-functions-modify.md#json_replace)
[JSON_SET()](/functions-and-operators/json-functions/json-functions-modify.md#json_set)
[JSON_TYPE()](/functions-and-operators/json-functions/json-functions-return.md#json_type)
[JSON_UNQUOTE()](/functions-and-operators/json-functions/json-functions-modify.md#json_unquote)
[JSON_VALID()](/functions-and-operators/json-functions/json-functions-return.md#json_valid)
[MEMBER OF()](/functions-and-operators/json-functions/json-functions-search.md#member-of) |
| [日期运算](/functions-and-operators/date-and-time-functions.md) | [DATE()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date)
[DATE_FORMAT()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format)
[DATEDIFF()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_datediff)
[DAYOFMONTH()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_dayofmonth)
[DAYOFWEEK()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_dayofweek)
[DAYOFYEAR()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_dayofyear)
[FROM_DAYS()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_from-days)
[HOUR()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_hour)
[MAKEDATE()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_makedate)
[MAKETIME()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_maketime)
[MICROSECOND()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_microsecond)
[MINUTE()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_minute)
[MONTH()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_month)
[MONTHNAME()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_monthname)
[PERIOD_ADD()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_period-add)
[PERIOD_DIFF()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_period-diff)
[SEC_TO_TIME()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_sec-to-time)
[SECOND()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_second)
[SYSDATE()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_sysdate)
[TIME_TO_SEC()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_time-to-sec)
[TIMEDIFF()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_timediff)
[WEEK()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_week)
[WEEKOFYEAR()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_weekofyear)
[YEAR()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_year)
[DATE_ADD()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-add)
[DATE_SUB()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-sub)
[ADDDATE()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_adddate)
[SUBDATE()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_subdate)
[FROM_UNIXTIME()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_from-unixtime)
[TIMESTAMPDIFF()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_timestampdiff)
[UNIX_TIMESTAMP()](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_unix-timestamp) |
| [字符串函数](/functions-and-operators/string-functions.md) | [ASCII()](/functions-and-operators/string-functions.md#ascii)
[BIT_LENGTH()](/functions-and-operators/string-functions.md#bit_length)
[CHAR()](/functions-and-operators/string-functions.md#char)
[CHAR_LENGTH()](/functions-and-operators/string-functions.md#char_length)
[CONCAT()](/functions-and-operators/string-functions.md#concat)
[CONCAT_WS()](/functions-and-operators/string-functions.md#concat_ws)
[ELT()](/functions-and-operators/string-functions.md#elt)
[FIELD()](/functions-and-operators/string-functions.md#field)
[HEX()](/functions-and-operators/string-functions.md#hex)
[LENGTH()](/functions-and-operators/string-functions.md#length)
[LIKE](/functions-and-operators/string-functions.md#like)
[LOWER()](/functions-and-operators/string-functions.md#lower)
[LTRIM()](/functions-and-operators/string-functions.md#ltrim)
[MID()](/functions-and-operators/string-functions.md#mid)
[NOT LIKE](/functions-and-operators/string-functions.md#not-like)
[NOT REGEXP](/functions-and-operators/string-functions.md#not-regexp)
[REGEXP](/functions-and-operators/string-functions.md#regexp)
[REGEXP_LIKE()](/functions-and-operators/string-functions.md#regexp_like)
[REGEXP_REPLACE()](/functions-and-operators/string-functions.md#regexp_replace)
[REGEXP_SUBSTR()](/functions-and-operators/string-functions.md#regexp_substr)
[REPLACE()](/functions-and-operators/string-functions.md#replace)
[REVERSE()](/functions-and-operators/string-functions.md#reverse)
[RIGHT()](/functions-and-operators/string-functions.md#right), [RLIKE](/functions-and-operators/string-functions.md#rlike)
[RTRIM()](/functions-and-operators/string-functions.md#rtrim)
[SPACE()](/functions-and-operators/string-functions.md#space)
[STRCMP()](/functions-and-operators/string-functions.md#strcmp)
[SUBSTR()](/functions-and-operators/string-functions.md#substr)
[SUBSTRING()](/functions-and-operators/string-functions.md#substring)
[UPPER()](/functions-and-operators/string-functions.md#upper) |
-| [聚合函数](/functions-and-operators/aggregate-group-by-functions.md#group-by-聚合函数) | [COUNT()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_count)
[COUNT(DISTINCT)](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_count-distinct)
[SUM()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_sum)
[AVG()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_avg)
[MAX()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_max)
[MIN()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_min)
[VARIANCE()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_variance)
[VAR_POP()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_var-pop)
[STD()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_std)
[STDDEV()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_stddev)
[STDDEV_POP](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_stddev-pop)
[VAR_SAMP()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_var-samp)
[STDDEV_SAMP()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_stddev-samp)
[JSON_ARRAYAGG(key)](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_json-arrayagg)
[JSON_OBJECTAGG(key, value)](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_json-objectagg) |
+| [聚合函数](/functions-and-operators/aggregate-group-by-functions.md#group-by-聚合函数) | [COUNT()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_count)
[COUNT(DISTINCT)](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_count-distinct)
[SUM()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_sum)
[`SUM_INT()`](/functions-and-operators/aggregate-group-by-functions.md)
[AVG()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_avg)
[MAX()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_max)
[MIN()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_min)
[VARIANCE()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_variance)
[VAR_POP()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_var-pop)
[STD()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_std)
[STDDEV()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_stddev)
[STDDEV_POP](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_stddev-pop)
[VAR_SAMP()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_var-samp)
[STDDEV_SAMP()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_stddev-samp)
[JSON_ARRAYAGG(key)](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_json-arrayagg)
[JSON_OBJECTAGG(key, value)](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_json-objectagg) |
| [加密和压缩函数](/functions-and-operators/encryption-and-compression-functions.md#加密和压缩函数) | [MD5()](/functions-and-operators/encryption-and-compression-functions.md#md5)
[SHA1(), SHA()](/functions-and-operators/encryption-and-compression-functions.md#sha1)
[UNCOMPRESSED_LENGTH()](/functions-and-operators/encryption-and-compression-functions.md#uncompressed_length) |
| [Cast 函数](/functions-and-operators/cast-functions-and-operators.md#cast-函数和操作符) | [CAST()](/functions-and-operators/cast-functions-and-operators.md#cast)
[CONVERT()](/functions-and-operators/cast-functions-and-operators.md#convert) |
| [其他函数](/functions-and-operators/miscellaneous-functions.md#支持的函数) | [UUID()](/functions-and-operators/miscellaneous-functions.md#uuid) |
diff --git a/functions-and-operators/window-functions.md b/functions-and-operators/window-functions.md
index 331664b9c01a..423db32d7303 100644
--- a/functions-and-operators/window-functions.md
+++ b/functions-and-operators/window-functions.md
@@ -1,7 +1,7 @@
---
title: 窗口函数
aliases: ['/docs-cn/dev/functions-and-operators/window-functions/','/docs-cn/dev/reference/sql/functions-and-operators/window-functions/']
-summary: TiDB 中的窗口函数与 MySQL 8.0 基本一致。可以将 `tidb_enable_window_function` 设置为 `0` 来解决升级后无法解析语法的问题。TiDB 支持除 `GROUP_CONCAT()` 和 `APPROX_PERCENTILE()` 以外的所有 `GROUP BY` 聚合函数。其他支持的窗口函数包括 `CUME_DIST()`、`DENSE_RANK()`、`FIRST_VALUE()`、`LAG()`、`LAST_VALUE()`、`LEAD()`、`NTH_VALUE()`、`NTILE()`、`PERCENT_RANK()`、`RANK()` 和 `ROW_NUMBER()`。这些函数可以下推到 TiFlash。
+summary: TiDB 中的窗口函数与 MySQL 8.0 基本一致。可以将 `tidb_enable_window_function` 设置为 `0` 来解决升级后无法解析语法的问题。TiDB 支持除 `GROUP_CONCAT()`、`APPROX_PERCENTILE()` 和 `APPROX_COUNT_DISTINCT()` 以外的所有 `GROUP BY` 聚合函数作为窗口函数,其中包括 TiDB 特有的 `SUM_INT()`。其他支持的窗口函数包括 `CUME_DIST()`、`DENSE_RANK()`、`FIRST_VALUE()`、`LAG()`、`LAST_VALUE()`、`LEAD()`、`NTH_VALUE()`、`NTILE()`、`PERCENT_RANK()`、`RANK()` 和 `ROW_NUMBER()`。这些函数可以下推到 TiFlash。
---
# 窗口函数
@@ -16,7 +16,7 @@ TiDB 中窗口函数的使用方法与 MySQL 8.0 基本一致,详情可参见
[本页](/tiflash/tiflash-supported-pushdown-calculations.md)列出的窗口函数可以下推到 TiFlash。
-TiDB 支持除 `GROUP_CONCAT()` 和 `APPROX_PERCENTILE()` 以外的所有 [`GROUP BY` 聚合函数](/functions-and-operators/aggregate-group-by-functions.md)作为窗口函数。此外,TiDB 支持的其他窗口函数如下:
+TiDB 支持除 `GROUP_CONCAT()`、`APPROX_PERCENTILE()` 和 `APPROX_COUNT_DISTINCT()` 以外的所有 [`GROUP BY` 聚合函数](/functions-and-operators/aggregate-group-by-functions.md)作为窗口函数,其中包括 TiDB 特有的 `SUM_INT()`。此外,TiDB 支持的其他窗口函数如下:
| 函数名 | 功能描述 |
| :-------------- | :------------------------------------- |
diff --git a/tiflash/tiflash-supported-pushdown-calculations.md b/tiflash/tiflash-supported-pushdown-calculations.md
index aa69e7f499f5..10a544f062b1 100644
--- a/tiflash/tiflash-supported-pushdown-calculations.md
+++ b/tiflash/tiflash-supported-pushdown-calculations.md
@@ -39,7 +39,7 @@ TiFlash 支持部分算子的下推,支持的算子如下:
| [JSON 函数](/functions-and-operators/json-functions.md) | `JSON_LENGTH()`, `->`, `->>`, `JSON_EXTRACT()`, `JSON_ARRAY()`, `JSON_DEPTH()`, `JSON_VALID()`, `JSON_KEYS()`, `JSON_CONTAINS_PATH()`, `JSON_UNQUOTE()` |
| [向量函数](/ai/reference/vector-search-functions-and-operators.md) | `VEC_L2_DISTANCE`, `VEC_COSINE_DISTANCE`, `VEC_NEGATIVE_INNER_PRODUCT`, `VEC_L1_DISTANCE`, `VEC_DIMS`, `VEC_L2_NORM`, `VEC_AS_TEXT` |
| [转换函数](/functions-and-operators/cast-functions-and-operators.md) | `CAST(int AS DOUBLE), CAST(int AS DECIMAL)`, `CAST(int AS STRING)`, `CAST(int AS TIME)`, `CAST(double AS INT)`, `CAST(double AS DECIMAL)`, `CAST(double AS STRING)`, `CAST(double AS TIME)`, `CAST(string AS INT)`, `CAST(string AS DOUBLE), CAST(string AS DECIMAL)`, `CAST(string AS TIME)`, `CAST(decimal AS INT)`, `CAST(decimal AS STRING)`, `CAST(decimal AS TIME)`, `CAST(decimal AS DOUBLE)`, `CAST(time AS INT)`, `CAST(time AS DECIMAL)`, `CAST(time AS STRING)`, `CAST(time AS REAL)`, `CAST(json AS JSON)`, `CAST(json AS STRING)`, `CAST(int AS JSON)`, `CAST(real AS JSON)`, `CAST(decimal AS JSON)`, `CAST(string AS JSON)`, `CAST(time AS JSON)`, `CAST(duration AS JSON)` |
-| [聚合函数](/functions-and-operators/aggregate-group-by-functions.md) | `MIN()`, `MAX()`, `SUM()`, `COUNT()`, `AVG()`, `APPROX_COUNT_DISTINCT()`, `GROUP_CONCAT()` |
+| [聚合函数](/functions-and-operators/aggregate-group-by-functions.md) | `MIN()`, `MAX()`, `SUM()`, `SUM_INT()`, `COUNT()`, `AVG()`, `APPROX_COUNT_DISTINCT()`, `GROUP_CONCAT()` |
| [其他函数](/functions-and-operators/miscellaneous-functions.md) | `INET_NTOA()`, `INET_ATON()`, `INET6_NTOA()`, `INET6_ATON()` |
## 下推限制