This is an automated email from the ASF dual-hosted git repository.
morningman 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 a4d648948e [Enhancement](function) add more explaination for function
percentile (#1078)
a4d648948e is described below
commit a4d648948ef34ce2c1ac67d64dba95de83ba0597
Author: zclllhhjj <[email protected]>
AuthorDate: Tue Sep 3 11:24:07 2024 +0800
[Enhancement](function) add more explaination for function percentile
(#1078)
# Versions
- [x] dev
- [x] 3.0
- [x] 2.1
- [x] 2.0
# Languages
- [x] Chinese
- [x] English
---
.../sql-functions/aggregate-functions/percentile.md | 20 ++++++++++----------
.../sql-functions/aggregate-functions/percentile.md | 19 ++++++++++---------
.../sql-functions/aggregate-functions/percentile.md | 19 ++++++++++---------
.../sql-functions/aggregate-functions/percentile.md | 19 ++++++++++---------
.../sql-functions/aggregate-functions/percentile.md | 19 ++++++++++---------
.../sql-functions/aggregate-functions/percentile.md | 19 ++++++++++---------
.../sql-functions/aggregate-functions/percentile.md | 20 ++++++++++----------
.../sql-functions/aggregate-functions/percentile.md | 20 ++++++++++----------
.../sql-functions/aggregate-functions/percentile.md | 20 ++++++++++----------
.../sql-functions/aggregate-functions/percentile.md | 20 ++++++++++----------
10 files changed, 100 insertions(+), 95 deletions(-)
diff --git a/docs/sql-manual/sql-functions/aggregate-functions/percentile.md
b/docs/sql-manual/sql-functions/aggregate-functions/percentile.md
index 4d5cc411fd..597736cceb 100644
--- a/docs/sql-manual/sql-functions/aggregate-functions/percentile.md
+++ b/docs/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-Calculate the exact percentile, suitable for small data volumes. Sort the
specified column in descending order first, and then take the exact p-th
percentile. The value of p is between 0 and 1
+Calculates the exact percentile for small amounts of data. The specified
columns are sorted in descending order and then the exact `p` percentile is
taken. The value of `p` is between `0` and `1`.
+If `p` does not point to an exact position, the linear interpolation of the
values adjacent to either side of the pointed position at the position pointed
to by `p` is returned. Note that this is not an average of the two numbers.
-Parameter Description:
-expr: required. The value is an integer (bigint at most).
-p: The exact percentile is required. The const value is [0.0,1.0]
+Parameters:
+`expr`: required. The value is an integer (`bigint` at most).
+`p`: required. The const value is `[0.0,1.0]`.
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99)|
@@ -51,8 +52,7 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
| NULL |
+-----------------------+
-
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/percentile.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/percentile.md
index 40bdc6a839..f1ee79ff30 100755
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/percentile.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
-### description
+### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 p 位百分数。p的值介于0到1之间
+计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 `p` 位百分数。`p` 的值介于 `0` 到 `1` 之间
+如果 `p` 不指向精确的位置,则返回所指位置两侧相邻数值在 `p` 所指位置上产生的线性插值。注意这不是两数字的平均数。
参数说明
-expr:必填。值为整数(最大为bigint) 类型的列。
-p:常量必填。需要精确的百分位数。取值为 [0.0,1.0]。
+`expr`:必填。值为整数(最大为 `bigint`) 类型的列。
+`p`:常量,必填。需要精确的百分位数。取值为 `[0.0,1.0]`。
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99) |
@@ -53,5 +54,5 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2/sql-manual/sql-functions/aggregate-functions/percentile.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2/sql-manual/sql-functions/aggregate-functions/percentile.md
index 40bdc6a839..f1ee79ff30 100755
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2/sql-manual/sql-functions/aggregate-functions/percentile.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
-### description
+### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 p 位百分数。p的值介于0到1之间
+计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 `p` 位百分数。`p` 的值介于 `0` 到 `1` 之间
+如果 `p` 不指向精确的位置,则返回所指位置两侧相邻数值在 `p` 所指位置上产生的线性插值。注意这不是两数字的平均数。
参数说明
-expr:必填。值为整数(最大为bigint) 类型的列。
-p:常量必填。需要精确的百分位数。取值为 [0.0,1.0]。
+`expr`:必填。值为整数(最大为 `bigint`) 类型的列。
+`p`:常量,必填。需要精确的百分位数。取值为 `[0.0,1.0]`。
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99) |
@@ -53,5 +54,5 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-functions/aggregate-functions/percentile.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-functions/aggregate-functions/percentile.md
index 40bdc6a839..f1ee79ff30 100755
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-functions/aggregate-functions/percentile.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
-### description
+### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 p 位百分数。p的值介于0到1之间
+计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 `p` 位百分数。`p` 的值介于 `0` 到 `1` 之间
+如果 `p` 不指向精确的位置,则返回所指位置两侧相邻数值在 `p` 所指位置上产生的线性插值。注意这不是两数字的平均数。
参数说明
-expr:必填。值为整数(最大为bigint) 类型的列。
-p:常量必填。需要精确的百分位数。取值为 [0.0,1.0]。
+`expr`:必填。值为整数(最大为 `bigint`) 类型的列。
+`p`:常量,必填。需要精确的百分位数。取值为 `[0.0,1.0]`。
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99) |
@@ -53,5 +54,5 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/percentile.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/percentile.md
index 40bdc6a839..f1ee79ff30 100755
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/percentile.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
-### description
+### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 p 位百分数。p的值介于0到1之间
+计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 `p` 位百分数。`p` 的值介于 `0` 到 `1` 之间
+如果 `p` 不指向精确的位置,则返回所指位置两侧相邻数值在 `p` 所指位置上产生的线性插值。注意这不是两数字的平均数。
参数说明
-expr:必填。值为整数(最大为bigint) 类型的列。
-p:常量必填。需要精确的百分位数。取值为 [0.0,1.0]。
+`expr`:必填。值为整数(最大为 `bigint`) 类型的列。
+`p`:常量,必填。需要精确的百分位数。取值为 `[0.0,1.0]`。
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99) |
@@ -53,5 +54,5 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/aggregate-functions/percentile.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/aggregate-functions/percentile.md
index 40bdc6a839..f1ee79ff30 100755
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/aggregate-functions/percentile.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
-### description
+### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 p 位百分数。p的值介于0到1之间
+计算精确的百分位数,适用于小数据量。先对指定列降序排列,然后取精确的第 `p` 位百分数。`p` 的值介于 `0` 到 `1` 之间
+如果 `p` 不指向精确的位置,则返回所指位置两侧相邻数值在 `p` 所指位置上产生的线性插值。注意这不是两数字的平均数。
参数说明
-expr:必填。值为整数(最大为bigint) 类型的列。
-p:常量必填。需要精确的百分位数。取值为 [0.0,1.0]。
+`expr`:必填。值为整数(最大为 `bigint`) 类型的列。
+`p`:常量,必填。需要精确的百分位数。取值为 `[0.0,1.0]`。
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99) |
@@ -53,5 +54,5 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
diff --git
a/versioned_docs/version-1.2/sql-manual/sql-functions/aggregate-functions/percentile.md
b/versioned_docs/version-1.2/sql-manual/sql-functions/aggregate-functions/percentile.md
index 4d5cc411fd..597736cceb 100644
---
a/versioned_docs/version-1.2/sql-manual/sql-functions/aggregate-functions/percentile.md
+++
b/versioned_docs/version-1.2/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-Calculate the exact percentile, suitable for small data volumes. Sort the
specified column in descending order first, and then take the exact p-th
percentile. The value of p is between 0 and 1
+Calculates the exact percentile for small amounts of data. The specified
columns are sorted in descending order and then the exact `p` percentile is
taken. The value of `p` is between `0` and `1`.
+If `p` does not point to an exact position, the linear interpolation of the
values adjacent to either side of the pointed position at the position pointed
to by `p` is returned. Note that this is not an average of the two numbers.
-Parameter Description:
-expr: required. The value is an integer (bigint at most).
-p: The exact percentile is required. The const value is [0.0,1.0]
+Parameters:
+`expr`: required. The value is an integer (`bigint` at most).
+`p`: required. The const value is `[0.0,1.0]`.
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99)|
@@ -51,8 +52,7 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
| NULL |
+-----------------------+
-
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
diff --git
a/versioned_docs/version-2.0/sql-manual/sql-functions/aggregate-functions/percentile.md
b/versioned_docs/version-2.0/sql-manual/sql-functions/aggregate-functions/percentile.md
index 4d5cc411fd..597736cceb 100644
---
a/versioned_docs/version-2.0/sql-manual/sql-functions/aggregate-functions/percentile.md
+++
b/versioned_docs/version-2.0/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-Calculate the exact percentile, suitable for small data volumes. Sort the
specified column in descending order first, and then take the exact p-th
percentile. The value of p is between 0 and 1
+Calculates the exact percentile for small amounts of data. The specified
columns are sorted in descending order and then the exact `p` percentile is
taken. The value of `p` is between `0` and `1`.
+If `p` does not point to an exact position, the linear interpolation of the
values adjacent to either side of the pointed position at the position pointed
to by `p` is returned. Note that this is not an average of the two numbers.
-Parameter Description:
-expr: required. The value is an integer (bigint at most).
-p: The exact percentile is required. The const value is [0.0,1.0]
+Parameters:
+`expr`: required. The value is an integer (`bigint` at most).
+`p`: required. The const value is `[0.0,1.0]`.
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99)|
@@ -51,8 +52,7 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
| NULL |
+-----------------------+
-
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
diff --git
a/versioned_docs/version-2.1/sql-manual/sql-functions/aggregate-functions/percentile.md
b/versioned_docs/version-2.1/sql-manual/sql-functions/aggregate-functions/percentile.md
index 4d5cc411fd..597736cceb 100644
---
a/versioned_docs/version-2.1/sql-manual/sql-functions/aggregate-functions/percentile.md
+++
b/versioned_docs/version-2.1/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-Calculate the exact percentile, suitable for small data volumes. Sort the
specified column in descending order first, and then take the exact p-th
percentile. The value of p is between 0 and 1
+Calculates the exact percentile for small amounts of data. The specified
columns are sorted in descending order and then the exact `p` percentile is
taken. The value of `p` is between `0` and `1`.
+If `p` does not point to an exact position, the linear interpolation of the
values adjacent to either side of the pointed position at the position pointed
to by `p` is returned. Note that this is not an average of the two numbers.
-Parameter Description:
-expr: required. The value is an integer (bigint at most).
-p: The exact percentile is required. The const value is [0.0,1.0]
+Parameters:
+`expr`: required. The value is an integer (`bigint` at most).
+`p`: required. The const value is `[0.0,1.0]`.
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99)|
@@ -51,8 +52,7 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
| NULL |
+-----------------------+
-
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
diff --git
a/versioned_docs/version-3.0/sql-manual/sql-functions/aggregate-functions/percentile.md
b/versioned_docs/version-3.0/sql-manual/sql-functions/aggregate-functions/percentile.md
index 4d5cc411fd..597736cceb 100644
---
a/versioned_docs/version-3.0/sql-manual/sql-functions/aggregate-functions/percentile.md
+++
b/versioned_docs/version-3.0/sql-manual/sql-functions/aggregate-functions/percentile.md
@@ -24,20 +24,21 @@ specific language governing permissions and limitations
under the License.
-->
-## PERCENTILE
### Description
#### Syntax
`PERCENTILE(expr, DOUBLE p)`
-Calculate the exact percentile, suitable for small data volumes. Sort the
specified column in descending order first, and then take the exact p-th
percentile. The value of p is between 0 and 1
+Calculates the exact percentile for small amounts of data. The specified
columns are sorted in descending order and then the exact `p` percentile is
taken. The value of `p` is between `0` and `1`.
+If `p` does not point to an exact position, the linear interpolation of the
values adjacent to either side of the pointed position at the position pointed
to by `p` is returned. Note that this is not an average of the two numbers.
-Parameter Description:
-expr: required. The value is an integer (bigint at most).
-p: The exact percentile is required. The const value is [0.0,1.0]
+Parameters:
+`expr`: required. The value is an integer (`bigint` at most).
+`p`: required. The const value is `[0.0,1.0]`.
-### example
-```
+### Example
+
+```sql
MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by
`table`;
+---------------------+---------------------------+
| table | percentile(`cost_time`, 0.99)|
@@ -51,8 +52,7 @@ MySQL > select percentile(NULL,0.3) from table1;
+-----------------------+
| NULL |
+-----------------------+
-
```
-### keywords
-PERCENTILE
+### Keywords
+ PERCENTILE
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]