This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new d5fc0ad0eb4 add min/max and adjust some others (#2699)
d5fc0ad0eb4 is described below

commit d5fc0ad0eb497c1f4933535dcd5a7e3d660bf623
Author: Pxl <[email protected]>
AuthorDate: Tue Aug 5 14:55:04 2025 +0800

    add min/max and adjust some others (#2699)
    
    ## Versions
    
    - [ ] dev
    - [ ] 3.0
    - [ ] 2.1
    - [ ] 2.0
    
    ## Languages
    
    - [ ] Chinese
    - [ ] English
    
    ## Docs Checklist
    
    - [ ] Checked by AI
    - [ ] Test Cases Built
---
 .../sql-functions/aggregate-functions/any-value.md | 259 +++------------------
 .../aggregate-functions/approx-count-distinct.md   | 183 +--------------
 .../sql-functions/aggregate-functions/max.md       |  82 ++++++-
 .../sql-functions/aggregate-functions/min.md       |  81 ++++++-
 .../sql-functions/aggregate-functions/any-value.md | 118 +---------
 .../aggregate-functions/approx-count-distinct.md   | 183 +--------------
 .../sql-functions/aggregate-functions/max.md       |  81 ++++++-
 .../sql-functions/aggregate-functions/min.md       |  81 ++++++-
 8 files changed, 351 insertions(+), 717 deletions(-)

diff --git a/docs/sql-manual/sql-functions/aggregate-functions/any-value.md 
b/docs/sql-manual/sql-functions/aggregate-functions/any-value.md
index 44dedda3537..9537e06ff9b 100644
--- a/docs/sql-manual/sql-functions/aggregate-functions/any-value.md
+++ b/docs/sql-manual/sql-functions/aggregate-functions/any-value.md
@@ -24,7 +24,7 @@ ANY(<expr>)
 
 | Parameter | Description |
 | -- | -- |
-| `<expr>` | The column or expression to be aggregated. Supported types are 
String, Date, DateTime, IPv4, IPv6, Bool, TinyInt, SmallInt, Integer, BigInt, 
LargeInt, Float, Double, Decimal. |
+| `<expr>` | The column or expression to be aggregated. Supported types are 
String, Date, DateTime, IPv4, IPv6, Bool, TinyInt, SmallInt, Integer, BigInt, 
LargeInt, Float, Double, Decimal, Array, Map, Struct, AggState, Bitmap, HLL, 
QuantileState. |
 
 ## Return Value
 
@@ -38,231 +38,22 @@ The return type is consistent with the input expr type.
 create table t1(
         k1 int,
         k_string varchar(100),
-        k_date date,
-        k_datetime datetime,
-        k_ipv4 ipv4,
-        k_ipv6 ipv6,
-        k_bool boolean,
-        k_tinyint tinyint,
-        k_smallint smallint,
-        k_bigint bigint,
-        k_largeint largeint,
-        k_float float,
-        k_double double,
         k_decimal decimal(10, 2)
 ) distributed by hash (k1) buckets 1
 properties ("replication_num"="1");
 insert into t1 values 
-    (1, 'apple', '2023-01-01', '2023-01-01 10:00:00', '192.168.1.1', '::1', 
true, 10, 100, 1000, 10000, 1.1, 1.11, 10.01),
-    (1, 'banana', '2023-01-02', '2023-01-02 11:00:00', '192.168.1.2', 
'2001:db8::1', false, 20, 200, 2000, 20000, 2.2, 2.22, 20.02),
-    (1, 'apple', '2023-01-01', '2023-01-01 10:00:00', '192.168.1.1', '::1', 
true, 10, 100, 1000, 10000, 1.1, 1.11, 10.01),
-    (2, 'orange', '2023-02-01', '2023-02-01 12:00:00', '10.0.0.1', 
'2001:db8::2', true, 30, 300, 3000, 30000, 3.3, 3.33, 30.03),
-    (2, 'orange', '2023-02-01', '2023-02-01 12:00:00', '10.0.0.1', 
'2001:db8::2', false, 40, 400, 4000, 40000, 4.4, 4.44, 40.04),
-    (2, 'grape', '2023-02-02', '2023-02-02 13:00:00', '10.0.0.2', 
'2001:db8::3', true, 50, 500, 5000, 50000, 5.5, 5.55, 50.05),
-    (3, null, null, null, null, null, null, null, null, null, null, null, 
null, null);
-```
-
-```sql
-select any_value(k_string) from t1;
-```
-
-String type: Get any value from all k_string values, NULL values are excluded.
-
-```text
-+---------------------+
-| any_value(k_string) |
-+---------------------+
-| orange              |
-+---------------------+
-```
-
-```sql
-select any_value(k_date) from t1;
-```
-
-Date type: Get any value from all k_date values.
-
-```text
-+-------------------+
-| any_value(k_date) |
-+-------------------+
-| 2023-01-01        |
-+-------------------+
-```
-
-```sql
-select any_value(k_datetime) from t1;
-```
-
-DateTime type: Get any value from all k_datetime values.
-
-```text
-+-----------------------+
-| any_value(k_datetime) |
-+-----------------------+
-| 2023-01-01 10:00:00   |
-+-----------------------+
-```
-
-```sql
-select any_value(k_ipv4) from t1;
-```
-
-IPv4 type: Get any value from all k_ipv4 values.
-
-```text
-+-------------------+
-| any_value(k_ipv4) |
-+-------------------+
-| 192.168.1.1       |
-+-------------------+
-```
-
-```sql
-select any_value(k_ipv6) from t1;
-```
-
-IPv6 type: Get any value from all k_ipv6 values.
-
-```text
-+-------------------+
-| any_value(k_ipv6) |
-+-------------------+
-| ::1               |
-+-------------------+
-```
-
-```sql
-select any_value(k_bool) from t1;
-```
-
-Bool type: Get any value from all k_bool values.
-
-```text
-+-------------------+
-| any_value(k_bool) |
-+-------------------+
-|                 1 |
-+-------------------+
-```
-
-```sql
-select any_value(k_tinyint) from t1;
-```
-
-TinyInt type: Get any value from all k_tinyint values.
-
-```text
-+----------------------+
-| any_value(k_tinyint) |
-+----------------------+
-|                   10 |
-+----------------------+
-```
-
-```sql
-select any_value(k_smallint) from t1;
-```
-
-SmallInt type: Get any value from all k_smallint values.
-
-```text
-+-----------------------+
-| any_value(k_smallint) |
-+-----------------------+
-|                   100 |
-+-----------------------+
-```
-
-```sql
-select any_value(k1) from t1;
-```
-
-Integer type: Get any value from all k1 values.
-
-```text
-+---------------+
-| any_value(k1) |
-+---------------+
-|             1 |
-+---------------+
-```
-
-```sql
-select any_value(k_bigint) from t1;
-```
-
-BigInt type: Get any value from all k_bigint values.
-
-```text
-+---------------------+
-| any_value(k_bigint) |
-+---------------------+
-|                1000 |
-+---------------------+
-```
-
-```sql
-select any_value(k_largeint) from t1;
-```
-
-LargeInt type: Get any value from all k_largeint values.
-
-```text
-+-----------------------+
-| any_value(k_largeint) |
-+-----------------------+
-|                 10000 |
-+-----------------------+
-```
-
-```sql
-select any_value(k_float) from t1;
-```
-
-Float type: Get any value from all k_float values.
-
-```text
-+--------------------+
-| any_value(k_float) |
-+--------------------+
-|                1.1 |
-+--------------------+
-```
-
-```sql
-select any_value(k_double) from t1;
-```
-
-Double type: Get any value from all k_double values.
-
-```text
-+---------------------+
-| any_value(k_double) |
-+---------------------+
-|                1.11 |
-+---------------------+
-```
-
-```sql
-select any_value(k_decimal) from t1;
-```
-
-Decimal type: Get any value from all k_decimal values.
-
-```text
-+----------------------+
-| any_value(k_decimal) |
-+----------------------+
-|                10.01 |
-+----------------------+
+    (1, 'apple', 10.01),
+    (1, 'banana', 20.02),
+    (2, 'orange', 30.03),
+    (2, null, null),
+    (3, null, null);
 ```
 
 ```sql
 select k1, any_value(k_string) from t1 group by k1;
 ```
 
-Group by k1 and get any value from k_string in each group. When all records in 
a group are NULL, returns NULL.
+String type: For each group, returns any non-NULL value.
 
 ```text
 +------+---------------------+
@@ -275,24 +66,26 @@ Group by k1 and get any value from k_string in each group. 
When all records in a
 ```
 
 ```sql
-select any(k_string) from t1;
+select k1, any_value(k_decimal) from t1 group by k1;
 ```
 
-Using alias ANY, same effect as ANY_VALUE.
+Decimal type: Returns any non-NULL high-precision decimal value.
 
 ```text
-+---------------+
-| any(k_string) |
-+---------------+
-| orange        |
-+---------------+
++------+----------------------+
+| k1   | any_value(k_decimal) |
++------+----------------------+
+|    1 |                10.01 |
+|    2 |                30.03 |
+|    3 |                 NULL |
++------+----------------------+
 ```
 
 ```sql
-select any_value(k_string) from t1 where k1 = 999;
+select any_value(k_string) from t1 where k1 = 3;
 ```
 
-When query result is empty, returns NULL.
+When all values in the group are NULL, returns NULL.
 
 ```text
 +---------------------+
@@ -301,3 +94,19 @@ When query result is empty, returns NULL.
 | NULL                |
 +---------------------+
 ```
+
+```sql
+select k1, any(k_string) from t1 group by k1;
+```
+
+Using alias ANY, same effect as ANY_VALUE.
+
+```text
++------+---------------+
+| k1   | any(k_string) |
++------+---------------+
+|    1 | apple         |
+|    2 | orange        |
+|    3 | NULL          |
++------+---------------+
+```
diff --git 
a/docs/sql-manual/sql-functions/aggregate-functions/approx-count-distinct.md 
b/docs/sql-manual/sql-functions/aggregate-functions/approx-count-distinct.md
index 7aef4f13a52..5e6eeca0312 100644
--- a/docs/sql-manual/sql-functions/aggregate-functions/approx-count-distinct.md
+++ b/docs/sql-manual/sql-functions/aggregate-functions/approx-count-distinct.md
@@ -22,7 +22,7 @@ NDV(<expr>)
 
 | Parameters | Description |
 | -- | -- |
-| `<expr>` | The expression to get the value. Supported types are String, 
Date, DateTime, IPv4, IPv6, Bool, TinyInt, SmallInt, Integer, BigInt, LargeInt, 
Float, Double, Decimal. |
+| `<expr>` | The expression to get the value. Supported types are String, 
Date, DateTime, IPv4, IPv6, TinyInt, Bool, SmallInt, Integer, BigInt, LargeInt, 
Float, Double, Decimal. |
 
 ## Return Value
 
@@ -35,28 +35,17 @@ Returns a value of type BIGINT.
 create table t1(
         k1 int,
         k_string varchar(100),
-        k_date date,
-        k_datetime datetime,
-        k_ipv4 ipv4,
-        k_ipv6 ipv6,
-        k_bool boolean,
-        k_tinyint tinyint,
-        k_smallint smallint,
-        k_bigint bigint,
-        k_largeint largeint,
-        k_float float,
-        k_double double,
-        k_decimal decimal(10, 2)
+        k_tinyint tinyint
 ) distributed by hash (k1) buckets 1
 properties ("replication_num"="1");
 insert into t1 values 
-    (1, 'apple', '2023-01-01', '2023-01-01 10:00:00', '192.168.1.1', '::1', 
true, 10, 100, 1000, 10000, 1.1, 1.11, 10.01),
-    (1, 'banana', '2023-01-02', '2023-01-02 11:00:00', '192.168.1.2', 
'2001:db8::1', false, 20, 200, 2000, 20000, 2.2, 2.22, 20.02),
-    (1, 'apple', '2023-01-01', '2023-01-01 10:00:00', '192.168.1.1', '::1', 
true, 10, 100, 1000, 10000, 1.1, 1.11, 10.01),
-    (2, 'orange', '2023-02-01', '2023-02-01 12:00:00', '10.0.0.1', 
'2001:db8::2', true, 30, 300, 3000, 30000, 3.3, 3.33, 30.03),
-    (2, 'orange', '2023-02-01', '2023-02-01 12:00:00', '10.0.0.1', 
'2001:db8::2', false, 40, 400, 4000, 40000, 4.4, 4.44, 40.04),
-    (2, 'grape', '2023-02-02', '2023-02-02 13:00:00', '10.0.0.2', 
'2001:db8::3', true, 50, 500, 5000, 50000, 5.5, 5.55, 50.05),
-    (3, null, null, null, null, null, null, null, null, null, null, null, 
null, null);
+    (1, 'apple', 10),
+    (1, 'banana', 20),
+    (1, 'apple', 10),
+    (2, 'orange', 30),
+    (2, 'orange', 40),
+    (2, 'grape', 50),
+    (3, null, null);
 ```
 
 ```sql
@@ -73,76 +62,6 @@ String type: Calculate the approximate distinct count of all 
k_string values, NU
 +---------------------------------+
 ```
 
-```sql
-select approx_count_distinct(k_date) from t1;
-```
-
-Date type: Calculate the approximate distinct count of all k_date values.
-
-```text
-+-------------------------------+
-| approx_count_distinct(k_date) |
-+-------------------------------+
-|                             4 |
-+-------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_datetime) from t1;
-```
-
-DateTime type: Calculate the approximate distinct count of all k_datetime 
values.
-
-```text
-+-----------------------------------+
-| approx_count_distinct(k_datetime) |
-+-----------------------------------+
-|                                 4 |
-+-----------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_ipv4) from t1;
-```
-
-IPv4 type: Calculate the approximate distinct count of all k_ipv4 values.
-
-```text
-+-------------------------------+
-| approx_count_distinct(k_ipv4) |
-+-------------------------------+
-|                             4 |
-+-------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_ipv6) from t1;
-```
-
-IPv6 type: Calculate the approximate distinct count of all k_ipv6 values.
-
-```text
-+-------------------------------+
-| approx_count_distinct(k_ipv6) |
-+-------------------------------+
-|                             4 |
-+-------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_bool) from t1;
-```
-
-Bool type: Calculate the approximate distinct count of all k_bool values.
-
-```text
-+-------------------------------+
-| approx_count_distinct(k_bool) |
-+-------------------------------+
-|                             2 |
-+-------------------------------+
-```
-
 ```sql
 select approx_count_distinct(k_tinyint) from t1;
 ```
@@ -157,20 +76,6 @@ TinyInt type: Calculate the approximate distinct count of 
all k_tinyint values.
 +----------------------------------+
 ```
 
-```sql
-select approx_count_distinct(k_smallint) from t1;
-```
-
-SmallInt type: Calculate the approximate distinct count of all k_smallint 
values.
-
-```text
-+-----------------------------------+
-| approx_count_distinct(k_smallint) |
-+-----------------------------------+
-|                                 5 |
-+-----------------------------------+
-```
-
 ```sql
 select approx_count_distinct(k1) from t1;
 ```
@@ -185,76 +90,6 @@ Integer type: Calculate the approximate distinct count of 
all k1 values.
 +---------------------------+
 ```
 
-```sql
-select approx_count_distinct(k_bigint) from t1;
-```
-
-BigInt type: Calculate the approximate distinct count of all k_bigint values.
-
-```text
-+---------------------------------+
-| approx_count_distinct(k_bigint) |
-+---------------------------------+
-|                               5 |
-+---------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_largeint) from t1;
-```
-
-LargeInt type: Calculate the approximate distinct count of all k_largeint 
values.
-
-```text
-+-----------------------------------+
-| approx_count_distinct(k_largeint) |
-+-----------------------------------+
-|                                 5 |
-+-----------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_float) from t1;
-```
-
-Float type: Calculate the approximate distinct count of all k_float values.
-
-```text
-+--------------------------------+
-| approx_count_distinct(k_float) |
-+--------------------------------+
-|                              5 |
-+--------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_double) from t1;
-```
-
-Double type: Calculate the approximate distinct count of all k_double values.
-
-```text
-+---------------------------------+
-| approx_count_distinct(k_double) |
-+---------------------------------+
-|                               5 |
-+---------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_decimal) from t1;
-```
-
-Decimal type: Calculate the approximate distinct count of all k_decimal values.
-
-```text
-+----------------------------------+
-| approx_count_distinct(k_decimal) |
-+----------------------------------+
-|                                5 |
-+----------------------------------+
-```
-
 ```sql
 select k1, approx_count_distinct(k_string) from t1 group by k1;
 ```
diff --git a/docs/sql-manual/sql-functions/aggregate-functions/max.md 
b/docs/sql-manual/sql-functions/aggregate-functions/max.md
index 5da823097e8..ac90ba6628d 100644
--- a/docs/sql-manual/sql-functions/aggregate-functions/max.md
+++ b/docs/sql-manual/sql-functions/aggregate-functions/max.md
@@ -7,7 +7,7 @@
 
 ## Description
 
-The MAX function returns the maximum value of the expression.
+The MAX function returns the maximum non-NULL value of the expression.
 
 ## Syntax
 
@@ -19,22 +19,88 @@ MAX(<expr>)
 
 | Parameters | Description |
 | -- | -- |
-| `<expr>` | The expression needs to be obtained |
+| `<expr>` | The expression to get the value. Supported types are String, 
Time, Date, DateTime, IPv4, IPv6, TinyInt, SmallInt, Integer, BigInt, LargeInt, 
Float, Double, Decimal. |
 
 ## Return Value
 
 Returns the same data type as the input expression.
+If all records in the group are NULL, the function returns NULL.
+
 
 ## Example
 
 ```sql
-select max(scan_rows) from log_statis group by datetime;
+-- setup
+create table t1(
+        k1 int,
+        k_string varchar(100),
+        k_decimal decimal(10, 2)
+) distributed by hash (k1) buckets 1
+properties ("replication_num"="1");
+insert into t1 values 
+    (1, 'apple', 10.01),
+    (1, 'banana', 20.02),
+    (2, 'orange', 30.03),
+    (2, null, null),
+    (3, null, null);
+```
+
+```sql
+select k1, max(k_string) from t1 group by k1;
+```
+
+For String type: Returns the maximum string value for each group.
+
+```text
++------+---------------+
+| k1   | max(k_string) |
++------+---------------+
+|    1 | banana        |
+|    2 | orange        |
+|    3 | NULL          |
++------+---------------+
+```
+
+```sql
+select k1, max(k_decimal) from t1 group by k1;
+```
+
+For Decimal type: Returns the maximum high-precision decimal value.
+
+```text
++------+----------------+
+| k1   | max(k_decimal) |
++------+----------------+
+|    1 |          20.02 |
+|    2 |          30.03 |
+|    3 |           NULL |
++------+----------------+
+```
+
+```sql
+select max(k_string) from t1 where k1 = 3;
 ```
 
+When all values in the group are NULL, returns NULL.
+
+```text
++---------------+
+| max(k_string) |
++---------------+
+| NULL          |
++---------------+
+```
+
+```sql
+select max(k_string) from t1;
+```
+
+Returns the maximum value across all data.
+
 ```text
-+------------------+
-| max(`scan_rows`) |
-+------------------+
-|          4671587 |
-+------------------+
++---------------+
+| max(k_string) |
++---------------+
+| orange        |
++---------------+
 ```
diff --git a/docs/sql-manual/sql-functions/aggregate-functions/min.md 
b/docs/sql-manual/sql-functions/aggregate-functions/min.md
index 9b5b62e00ff..91402b0d64c 100644
--- a/docs/sql-manual/sql-functions/aggregate-functions/min.md
+++ b/docs/sql-manual/sql-functions/aggregate-functions/min.md
@@ -7,7 +7,7 @@
 
 ## Description
 
-The MIN function returns the minimum value of the expression.
+The MIN function returns the minimum non-NULL value of the expression.
 
 ## Syntax
 
@@ -19,22 +19,87 @@ MIN(<expr>)
 
 | Parameters | Description |
 | -- | -- |
-| `<expr>` | The expression needs to be obtained |
+| `<expr>` | The expression to get the value. Supported types are String, 
Time, Date, DateTime, IPv4, IPv6, TinyInt, SmallInt, Integer, BigInt, LargeInt, 
Float, Double, Decimal. |
 
 ## Return Value
 
 Returns the same data type as the input expression.
+If all records in the group are NULL, the function returns NULL.
 
 ## Example
 
 ```sql
-select MIN(scan_rows) from log_statis group by datetime;
+-- setup
+create table t1(
+        k1 int,
+        k_string varchar(100),
+        k_decimal decimal(10, 2)
+) distributed by hash (k1) buckets 1
+properties ("replication_num"="1");
+insert into t1 values 
+    (1, 'apple', 10.01),
+    (1, 'banana', 20.02),
+    (2, 'orange', 30.03),
+    (2, null, null),
+    (3, null, null);
 ```
 
+```sql
+select k1, min(k_string) from t1 group by k1;
+```
+
+String type: For each group, returns the minimum string value.
+
+```text
++------+---------------+
+| k1   | min(k_string) |
++------+---------------+
+|    1 | apple         |
+|    2 | orange        |
+|    3 | NULL          |
++------+---------------+
+```
+
+```sql
+select k1, min(k_decimal) from t1 group by k1;
+```
+
+Decimal type: Returns the minimum high-precision decimal value.
+
+```text
++------+----------------+
+| k1   | min(k_decimal) |
++------+----------------+
+|    1 |          10.01 |
+|    2 |          30.03 |
+|    3 |           NULL |
++------+----------------+
+```
+
+```sql
+select min(k_string) from t1 where k1 = 3;
+```
+
+When all values in the group are NULL, returns NULL.
+
+```text
++---------------+
+| min(k_string) |
++---------------+
+| NULL          |
++---------------+
+```
+
+```sql
+select min(k_string) from t1;
+```
+
+Minimum value of all data.
+
 ```text
-+------------------+
-| MIN(`scan_rows`) |
-+------------------+
-|                0 |
-+------------------+
++---------------+
+| min(k_string) |
++---------------+
+| apple         |
++---------------+
 ```
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/any-value.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/any-value.md
index b802162b62c..85caace6533 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/any-value.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/any-value.md
@@ -24,7 +24,7 @@ ANY(<expr>)
 
 | 参数 | 说明 |
 | -- | -- |
-| `<expr>` | 要聚合的列或表达式,支持类型为 
String,Date,DateTime,IPv4,IPv6,Bool,TinyInt,SmallInt,Integer,BigInt,LargeInt,Float,Double,Decimal。
 |
+| `<expr>` | 要聚合的列或表达式,支持类型为 
String,Date,DateTime,IPv4,IPv6,Bool,TinyInt,SmallInt,Integer,BigInt,LargeInt,Float,Double,Decimal,Array,Map,Struct,AggState,Bitmap,HLL,QuantileState。
 |
 
 ## 返回值
 
@@ -38,26 +38,15 @@ ANY(<expr>)
 create table t1(
         k1 int,
         k_string varchar(100),
-        k_date date,
-        k_datetime datetime,
-        k_ipv4 ipv4,
-        k_ipv6 ipv6,
-        k_bool boolean,
-        k_tinyint tinyint,
-        k_smallint smallint,
-        k_bigint bigint,
-        k_largeint largeint,
-        k_float float,
-        k_double double,
         k_decimal decimal(10, 2)
 ) distributed by hash (k1) buckets 1
 properties ("replication_num"="1");
 insert into t1 values 
-    (1, 'apple', '2023-01-01', '2023-01-01 10:00:00', '192.168.1.1', '::1', 
true, 10, 100, 1000, 10000, 1.1, 1.11, 10.01),
-    (1, 'banana', '2023-01-02', '2023-01-02 11:00:00', '192.168.1.2', 
'2001:db8::1', false, 20, 200, 2000, 20000, 2.2, 2.22, 20.02),
-    (2, 'orange', '2023-02-01', '2023-02-01 12:00:00', '10.0.0.1', 
'2001:db8::2', true, 30, 300, 3000, 30000, 3.3, 3.33, 30.03),
-    (2, null, null, null, null, null, null, null, null, null, null, null, 
null, null),
-    (3, null, null, null, null, null, null, null, null, null, null, null, 
null, null);
+    (1, 'apple', 10.01),
+    (1, 'banana', 20.02),
+    (2, 'orange', 30.03),
+    (2, null, null),
+    (3, null, null);
 ```
 
 ```sql
@@ -76,101 +65,6 @@ String 类型:对于每个分组,返回任意一个非 NULL 值。
 +------+-------------------+
 ```
 
-```sql
-select k1, any_value(k_date) from t1 group by k1;
-```
-
-Date 类型:返回任意一个非 NULL 的日期值。
-
-```text
-+------+-----------------+
-| k1   | any_value(k_date) |
-+------+-----------------+
-|    1 | 2023-01-01      |
-|    2 | 2023-02-01      |
-|    3 | NULL            |
-+------+-----------------+
-```
-
-```sql
-select k1, any_value(k_datetime) from t1 group by k1;
-```
-
-DateTime 类型:返回任意一个非 NULL 的日期时间值。
-
-```text
-+------+---------------------+
-| k1   | any_value(k_datetime) |
-+------+---------------------+
-|    1 | 2023-01-01 10:00:00 |
-|    2 | 2023-02-01 12:00:00 |
-|    3 | NULL                |
-+------+---------------------+
-```
-
-```sql
-select k1, any_value(k_ipv4) from t1 group by k1;
-```
-
-IPv4 类型:返回任意一个非 NULL 的 IPv4 地址值。
-
-```text
-+------+-----------------+
-| k1   | any_value(k_ipv4) |
-+------+-----------------+
-|    1 | 192.168.1.1     |
-|    2 | 10.0.0.1        |
-|    3 | NULL            |
-+------+-----------------+
-```
-
-```sql
-select k1, any_value(k_ipv6) from t1 group by k1;
-```
-
-IPv6 类型:返回任意一个非 NULL 的 IPv6 地址值。
-
-```text
-+------+-----------------+
-| k1   | any_value(k_ipv6) |
-+------+-----------------+
-|    1 | ::1             |
-|    2 | 2001:db8::2     |
-|    3 | NULL            |
-+------+-----------------+
-```
-
-```sql
-select k1, any_value(k_bool) from t1 group by k1;
-```
-
-Bool 类型:返回任意一个非 NULL 的布尔值。
-
-```text
-+------+-----------------+
-| k1   | any_value(k_bool) |
-+------+-----------------+
-|    1 |               1 |
-|    2 |               1 |
-|    3 |            NULL |
-+------+-----------------+
-```
-
-```sql
-select k1, any_value(k_tinyint) from t1 group by k1;
-```
-
-TinyInt 类型:返回任意一个非 NULL 的微小整数值。
-
-```text
-+------+--------------------+
-| k1   | any_value(k_tinyint) |
-+------+--------------------+
-|    1 |                 10 |
-|    2 |                 30 |
-|    3 |               NULL |
-+------+--------------------+
-```
 
 ```sql
 select k1, any_value(k_decimal) from t1 group by k1;
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/approx-count-distinct.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/approx-count-distinct.md
index 2067414d6da..14147b71e70 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/approx-count-distinct.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/approx-count-distinct.md
@@ -23,7 +23,7 @@ NDV(<expr>)
 
 | 参数 | 说明 |
 | -- | -- |
-| `<expr>` | 需要获取值的表达式,支持类型为 
String,Date,DateTime,IPv4,IPv6,Bool,TinyInt,SmallInt,Integer,BigInt,LargeInt,Float,Double,Decimal。|
+| `<expr>` | 用于计算的表达式。支持的类型包括 
String、Date、DateTime、IPv4、IPv6、TinyInt、SmallInt、Integer、BigInt、LargeInt、Float、Double、Decimal。|
 
 ## 返回值
 
@@ -36,28 +36,17 @@ NDV(<expr>)
 create table t1(
         k1 int,
         k_string varchar(100),
-        k_date date,
-        k_datetime datetime,
-        k_ipv4 ipv4,
-        k_ipv6 ipv6,
-        k_bool boolean,
-        k_tinyint tinyint,
-        k_smallint smallint,
-        k_bigint bigint,
-        k_largeint largeint,
-        k_float float,
-        k_double double,
-        k_decimal decimal(10, 2)
+        k_tinyint tinyint
 ) distributed by hash (k1) buckets 1
 properties ("replication_num"="1");
 insert into t1 values 
-    (1, 'apple', '2023-01-01', '2023-01-01 10:00:00', '192.168.1.1', '::1', 
true, 10, 100, 1000, 10000, 1.1, 1.11, 10.01),
-    (1, 'banana', '2023-01-02', '2023-01-02 11:00:00', '192.168.1.2', 
'2001:db8::1', false, 20, 200, 2000, 20000, 2.2, 2.22, 20.02),
-    (1, 'apple', '2023-01-01', '2023-01-01 10:00:00', '192.168.1.1', '::1', 
true, 10, 100, 1000, 10000, 1.1, 1.11, 10.01),
-    (2, 'orange', '2023-02-01', '2023-02-01 12:00:00', '10.0.0.1', 
'2001:db8::2', true, 30, 300, 3000, 30000, 3.3, 3.33, 30.03),
-    (2, 'orange', '2023-02-01', '2023-02-01 12:00:00', '10.0.0.1', 
'2001:db8::2', false, 40, 400, 4000, 40000, 4.4, 4.44, 40.04),
-    (2, 'grape', '2023-02-02', '2023-02-02 13:00:00', '10.0.0.2', 
'2001:db8::3', true, 50, 500, 5000, 50000, 5.5, 5.55, 50.05),
-    (3, null, null, null, null, null, null, null, null, null, null, null, 
null, null);
+    (1, 'apple', 10),
+    (1, 'banana', 20),
+    (1, 'apple', 10),
+    (2, 'orange', 30),
+    (2, 'orange', 40),
+    (2, 'grape', 50),
+    (3, null, null);
 ```
 
 ```sql
@@ -74,76 +63,6 @@ String 类型:计算所有 k_string 值的近似去重数量,NULL 值不参
 +---------------------------------+
 ```
 
-```sql
-select approx_count_distinct(k_date) from t1;
-```
-
-Date 类型:计算所有 k_date 值的近似去重数量。
-
-```text
-+-------------------------------+
-| approx_count_distinct(k_date) |
-+-------------------------------+
-|                             4 |
-+-------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_datetime) from t1;
-```
-
-DateTime 类型:计算所有 k_datetime 值的近似去重数量。
-
-```text
-+-----------------------------------+
-| approx_count_distinct(k_datetime) |
-+-----------------------------------+
-|                                 4 |
-+-----------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_ipv4) from t1;
-```
-
-IPv4 类型:计算所有 k_ipv4 值的近似去重数量。
-
-```text
-+-------------------------------+
-| approx_count_distinct(k_ipv4) |
-+-------------------------------+
-|                             4 |
-+-------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_ipv6) from t1;
-```
-
-IPv6 类型:计算所有 k_ipv6 值的近似去重数量。
-
-```text
-+-------------------------------+
-| approx_count_distinct(k_ipv6) |
-+-------------------------------+
-|                             4 |
-+-------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_bool) from t1;
-```
-
-Bool 类型:计算所有 k_bool 值的近似去重数量。
-
-```text
-+-------------------------------+
-| approx_count_distinct(k_bool) |
-+-------------------------------+
-|                             2 |
-+-------------------------------+
-```
-
 ```sql
 select approx_count_distinct(k_tinyint) from t1;
 ```
@@ -158,20 +77,6 @@ TinyInt 类型:计算所有 k_tinyint 值的近似去重数量。
 +----------------------------------+
 ```
 
-```sql
-select approx_count_distinct(k_smallint) from t1;
-```
-
-SmallInt 类型:计算所有 k_smallint 值的近似去重数量。
-
-```text
-+-----------------------------------+
-| approx_count_distinct(k_smallint) |
-+-----------------------------------+
-|                                 5 |
-+-----------------------------------+
-```
-
 ```sql
 select approx_count_distinct(k1) from t1;
 ```
@@ -186,76 +91,6 @@ Integer 类型:计算所有 k1 值的近似去重数量。
 +---------------------------+
 ```
 
-```sql
-select approx_count_distinct(k_bigint) from t1;
-```
-
-BigInt 类型:计算所有 k_bigint 值的近似去重数量。
-
-```text
-+---------------------------------+
-| approx_count_distinct(k_bigint) |
-+---------------------------------+
-|                               5 |
-+---------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_largeint) from t1;
-```
-
-LargeInt 类型:计算所有 k_largeint 值的近似去重数量。
-
-```text
-+-----------------------------------+
-| approx_count_distinct(k_largeint) |
-+-----------------------------------+
-|                                 5 |
-+-----------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_float) from t1;
-```
-
-Float 类型:计算所有 k_float 值的近似去重数量。
-
-```text
-+--------------------------------+
-| approx_count_distinct(k_float) |
-+--------------------------------+
-|                              5 |
-+--------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_double) from t1;
-```
-
-Double 类型:计算所有 k_double 值的近似去重数量。
-
-```text
-+---------------------------------+
-| approx_count_distinct(k_double) |
-+---------------------------------+
-|                               5 |
-+---------------------------------+
-```
-
-```sql
-select approx_count_distinct(k_decimal) from t1;
-```
-
-Decimal 类型:计算所有 k_decimal 值的近似去重数量。
-
-```text
-+----------------------------------+
-| approx_count_distinct(k_decimal) |
-+----------------------------------+
-|                                5 |
-+----------------------------------+
-```
-
 ```sql
 select k1, approx_count_distinct(k_string) from t1 group by k1;
 ```
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/max.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/max.md
index 92bfc5a4b12..d8a986dbb28 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/max.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/max.md
@@ -7,7 +7,7 @@
 
 ## 描述
 
-MAX 函数返回表达式的最大值。
+MAX 函数返回表达式的最大非 NULL 值。
 
 ## 语法
 
@@ -19,22 +19,87 @@ MAX(<expr>)
 
 | 参数 | 说明 |
 | -- | -- |
-| `<expr>` | 需要获取值的表达式  |
+| `<expr>` | 用于获取值的表达式。支持的类型包括 
String、Time、Date、DateTime、IPv4、IPv6、TinyInt、SmallInt、Integer、BigInt、LargeInt、Float、Double、Decimal。
 |
 
 ## 返回值
 
 返回与输入表达式相同的数据类型。
+如果组内所有记录均为 NULL,则函数返回 NULL。
 
 ## 举例
 
 ```sql
-select max(scan_rows) from log_statis group by datetime;
+-- setup
+create table t1(
+        k1 int,
+        k_string varchar(100),
+        k_decimal decimal(10, 2)
+) distributed by hash (k1) buckets 1
+properties ("replication_num"="1");
+insert into t1 values 
+    (1, 'apple', 10.01),
+    (1, 'banana', 20.02),
+    (2, 'orange', 30.03),
+    (2, null, null),
+    (3, null, null);
 ```
 
+```sql
+select k1, max(k_string) from t1 group by k1;
+```
+
+String 类型:对于每个分组,返回最大的字符串值。
+
+```text
++------+---------------+
+| k1   | max(k_string) |
++------+---------------+
+|    1 | banana        |
+|    2 | orange        |
+|    3 | NULL          |
++------+---------------+
+```
+
+```sql
+select k1, max(k_decimal) from t1 group by k1;
+```
+
+Decimal 类型:返回最大的高精度小数值。
+
+```text
++------+----------------+
+| k1   | max(k_decimal) |
++------+----------------+
+|    1 |          20.02 |
+|    2 |          30.03 |
+|    3 |           NULL |
++------+----------------+
+```
+
+```sql
+select max(k_string) from t1 where k1 = 3;
+```
+
+当组内所有值都为 NULL 时,返回 NULL。
+
+```text
++---------------+
+| max(k_string) |
++---------------+
+| NULL          |
++---------------+
+```
+
+```sql
+select max(k_string) from t1;
+```
+
+返回所有数据的最大值。
+
 ```text
-+------------------+
-| max(`scan_rows`) |
-+------------------+
-|          4671587 |
-+------------------+
++---------------+
+| max(k_string) |
++---------------+
+| orange        |
++---------------+
 ```
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/min.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/min.md
index d3fc34b4308..ab95a510908 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/min.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/min.md
@@ -7,7 +7,7 @@
 
 ## 描述
 
-MIN 函数返回表达式的最小值。
+MIN 函数返回表达式的最小非 NULL 值。
 
 ## 语法
 
@@ -19,22 +19,87 @@ MIN(<expr>)
 
 | 参数 | 说明 |
 | -- | -- |
-| `<expr>` | 需要获取值的表达式  |
+| `<expr>` | 用于计算的表达式。支持的类型包括 
String、Time、Date、DateTime、IPv4、IPv6、TinyInt、SmallInt、Integer、BigInt、LargeInt、Float、Double、Decimal。
 |
 
 ## 返回值
 
 返回与输入表达式相同的数据类型。
+如果组内所有记录均为 NULL,则函数返回 NULL。
 
 ## 举例
 
 ```sql
-select MIN(scan_rows) from log_statis group by datetime;
+-- setup
+create table t1(
+        k1 int,
+        k_string varchar(100),
+        k_decimal decimal(10, 2)
+) distributed by hash (k1) buckets 1
+properties ("replication_num"="1");
+insert into t1 values 
+    (1, 'apple', 10.01),
+    (1, 'banana', 20.02),
+    (2, 'orange', 30.03),
+    (2, null, null),
+    (3, null, null);
 ```
 
+```sql
+select k1, min(k_string) from t1 group by k1;
+```
+
+String 类型:对于每个分组,返回最小的字符串值。
+
+```text
++------+---------------+
+| k1   | min(k_string) |
++------+---------------+
+|    1 | apple         |
+|    2 | orange        |
+|    3 | NULL          |
++------+---------------+
+```
+
+```sql
+select k1, min(k_decimal) from t1 group by k1;
+```
+
+Decimal 类型:返回最小的高精度小数值。
+
+```text
++------+----------------+
+| k1   | min(k_decimal) |
++------+----------------+
+|    1 |          10.01 |
+|    2 |          30.03 |
+|    3 |           NULL |
++------+----------------+
+```
+
+```sql
+select min(k_string) from t1 where k1 = 3;
+```
+
+当组内所有值都为 NULL 时,返回 NULL。
+
+```text
++---------------+
+| min(k_string) |
++---------------+
+| NULL          |
++---------------+
+```
+
+```sql
+select min(k_string) from t1;
+```
+
+返回所有数据的最小值。
+
 ```text
-+------------------+
-| MIN(`scan_rows`) |
-+------------------+
-|                0 |
-+------------------+
++---------------+
+| min(k_string) |
++---------------+
+| apple         |
++---------------+
 ```


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to