This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 e8968070b5c [Feature](func) Support function
QUANTILE_STATE_TO/FROM_BASE64 (#3279)
e8968070b5c is described below
commit e8968070b5c78f80f17450e0587d04021ca29a97
Author: linrrarity <[email protected]>
AuthorDate: Sun Jan 18 19:53:13 2026 +0800
[Feature](func) Support function QUANTILE_STATE_TO/FROM_BASE64 (#3279)
## Versions
- [x] dev
- [x] 4.x
- [x] 3.x
- [x] 2.1
## Languages
- [x] Chinese
- [x] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
---
.../quantile-state-from-base64.md | 68 ++++++++++++++++
.../quantile-functions/quantile-state-to-base64.md | 91 +++++++++++++++++++++
.../quantile-state-from-base64.md | 67 ++++++++++++++++
.../quantile-functions/quantile-state-to-base64.md | 92 ++++++++++++++++++++++
4 files changed, 318 insertions(+)
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-from-base64.md
b/docs/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-from-base64.md
new file mode 100644
index 00000000000..17f08a5f534
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-from-base64.md
@@ -0,0 +1,68 @@
+---
+{
+ "title": "QUANTILE_STATE_FROM_BASE64",
+ "language": "en"
+}
+---
+
+## Description
+
+Converts a base64 encoded string (usually generated by
`QUANTILE_STATE_TO_BASE64`) to a QUANTILE_STATE type. Returns NULL if the input
string is invalid or NULL.
+
+## Syntax
+
+```sql
+QUANTILE_STATE_FROM_BASE64(<input>)
+```
+
+## Parameters
+
+| Parameter | Description |
+| --------- | ----------- |
+| `<input>` | A base64 encoded string, usually generated by
`QUANTILE_STATE_TO_BASE64`. Returns NULL if the string is invalid. |
+
+## Return Value
+
+Returns the quantile_state parsed from the base64 encoding. Returns NULL if
the string is invalid.
+
+## Examples
+
+```sql
+select
+ quantile_state_to_base64(
+ quantile_state_from_base64(
+ quantile_state_to_base64(to_quantile_state(1.0, 2048))
+ )
+ ) = quantile_state_to_base64(to_quantile_state(1.0, 2048)) AS equal_test;
+```
+```text
++------------+
+| equal_test |
++------------+
+| 1 |
++------------+
+```
+
+```sql
+select quantile_state_from_base64('not_base64!');
+```
+
+```text
++-------------------------------------------+
+| quantile_state_from_base64('not_base64!') |
++-------------------------------------------+
+| NULL |
++-------------------------------------------+
+```
+
+```sql
+select quantile_state_from_base64(NULL);
+```
+
+```text
++----------------------------------+
+| quantile_state_from_base64(NULL) |
++----------------------------------+
+| NULL |
++----------------------------------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-to-base64.md
b/docs/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-to-base64.md
new file mode 100644
index 00000000000..d9cf79f7e86
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-to-base64.md
@@ -0,0 +1,91 @@
+---
+{
+ "title": "QUANTILE_STATE_TO_BASE64",
+ "language": "en"
+}
+---
+
+## Description
+
+Converts a QUANTILE_STATE type to a base64 encoded string.
+
+## Syntax
+
+```sql
+QUANTILE_STATE_TO_BASE64(<quantile_state_input>)
+```
+
+## Parameters
+
+| Parameter | Description |
+| --------- | ----------- |
+| `<quantile_state_input>` | Data of QUANTILE_STATE type. |
+
+## Return Value
+
+The Base64 encoded string of the QUANTILE_STATE.
+Returns `NULL` if the QUANTILE_STATE is `NULL`.
+
+::: note
+
+Since the order of elements in QUANTILE_STATE cannot be guaranteed, the base64
result generated from the same QUANTILE_STATE content is not guaranteed to be
always the same, but the QUANTILE_STATE decoded by quantile_state_from_base64
is guaranteed to be the same.
+
+:::
+
+## Examples
+
+```sql
+select quantile_state_to_base64(quantile_state_empty());
+```
+
+```text
++--------------------------------------------------+
+| quantile_state_to_base64(quantile_state_empty()) |
++--------------------------------------------------+
+| AAAARQA= |
++--------------------------------------------------+
+```
+
+```sql
+select quantile_state_to_base64(to_quantile_state(1, 2048));
+```
+
+```text
++------------------------------------------------------+
+| quantile_state_to_base64(to_quantile_state(1, 2048)) |
++------------------------------------------------------+
+| AAAARQEAAAAAAADwPw== |
++------------------------------------------------------+
+```
+
+```sql
+select
+ quantile_percent(
+ quantile_union(
+ quantile_state_from_base64(
+ quantile_state_to_base64(to_quantile_state(1, 2048))
+ )
+ ),
+ 0.5
+ ) as nested_test;
+```
+
+```text
++-------------+
+| nested_test |
++-------------+
+| 1 |
++-------------+
+```
+
+```sql
+select quantile_state_to_base64(NULL);
+```
+
+```text
++--------------------------------+
+| quantile_state_to_base64(NULL) |
++--------------------------------+
+| NULL |
++--------------------------------+
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-from-base64.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-from-base64.md
new file mode 100644
index 00000000000..31dcacc877d
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-from-base64.md
@@ -0,0 +1,67 @@
+---
+{
+ "title": "QUANTILE_STATE_FROM_BASE64",
+ "language": "zh-CN",
+ "description": "将一个 base64 编码的字符串(通常由 QUANTILE_STATE_TO_BASE64 函数生成)转换为
QUANTILE_STATE 类型。如果输入字符串不合法或为 NULL,则返回 NULL。"
+}
+---
+
+## 描述
+
+将一个 base64 编码的字符串(通常由 `QUANTILE_STATE_TO_BASE64` 函数生成)转换为 QUANTILE_STATE
类型。如果输入字符串不合法或为 NULL,则返回 NULL。
+
+## 语法
+
+```sql
+QUANTILE_STATE_FROM_BASE64(<input>)
+```
+
+## 参数
+
+| 参数 | 说明
|
+| -------- |
------------------------------------------------------------------------ |
+| `<input>` | base64 编码的字符串,通常由 `QUANTILE_STATE_TO_BASE64` 函数生成。如果字符串不合法,则返回
NULL。 |
+
+## 返回值
+返回由 base64 编码解析后得到的 quantile_state参数,若字符串不合法,则返回 NULL。
+
+## 示例
+
+```sql
+select
+ quantile_state_to_base64(
+ quantile_state_from_base64(
+ quantile_state_to_base64(to_quantile_state(1.0, 2048))
+ )
+ ) = quantile_state_to_base64(to_quantile_state(1.0, 2048)) AS equal_test;
+```
+```text
++------------+
+| equal_test |
++------------+
+| 1 |
++------------+
+```
+
+```sql
+select quantile_state_from_base64('not_base64!');
+```
+
+```text
++-------------------------------------------+
+| quantile_state_from_base64('not_base64!') |
++-------------------------------------------+
+| NULL |
++-------------------------------------------+
+```
+
+```sql
+select quantile_state_from_base64(NULL);
+```
+```text
++----------------------------------+
+| quantile_state_from_base64(NULL) |
++----------------------------------+
+| NULL |
++----------------------------------+
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-to-base64.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-to-base64.md
new file mode 100644
index 00000000000..3c2a4be270c
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/quantile-functions/quantile-state-to-base64.md
@@ -0,0 +1,92 @@
+---
+{
+ "title": "QUANTILE_STATE_TO_BASE64",
+ "language": "zh-CN",
+ "description": "将一个 QUANTILE_STATE 类型转换为一个 base64 编码的字符串。"
+}
+---
+
+## 描述
+
+将一个 QUANTILE_STATE 类型转换为一个 base64 编码的字符串。
+
+## 语法
+
+```sql
+QUANTILE_STATE_TO_BASE64(<quantile_state_input>)
+```
+
+## 参数
+
+| 参数 | 说明 |
+|---------------|-----------|
+| `<quantile_state_input>` | QUANTILE_STATE 类型数据。 |
+
+## 返回值
+
+QUANTILE_STATE 基于 Base64 编码后的字符串。
+若 QUANTILE_STATE 为 `NULL` 时,返回值为 `NULL`。
+
+::: note
+
+由于不能保证 QUANTILE_STATE 中元素的顺序,因此不能保证相同内容的 QUANTILE_STATE 生成的 base64
结果始终相同,但可以保证 quantile_state_from_base64 解码后的 QUANTILE_STATE 相同。
+
+:::
+
+## 示例
+
+```sql
+select quantile_state_to_base64(quantile_state_empty());
+```
+
+```text
++--------------------------------------------------+
+| quantile_state_to_base64(quantile_state_empty()) |
++--------------------------------------------------+
+| AAAARQA= |
++--------------------------------------------------+
+```
+
+```sql
+select quantile_state_to_base64(to_quantile_state(1, 2048));
+```
+
+```text
++------------------------------------------------------+
+| quantile_state_to_base64(to_quantile_state(1, 2048)) |
++------------------------------------------------------+
+| AAAARQEAAAAAAADwPw== |
++------------------------------------------------------+
+```
+
+```sql
+select
+ quantile_percent(
+ quantile_union(
+ quantile_state_from_base64(
+ quantile_state_to_base64(to_quantile_state(1, 2048))
+ )
+ ),
+ 0.5
+ ) as nested_test;
+```
+
+```text
++-------------+
+| nested_test |
++-------------+
+| 1 |
++-------------+
+```
+
+```sql
+select quantile_state_to_base64(NULL);
+```
+
+```text
++--------------------------------+
+| quantile_state_to_base64(NULL) |
++--------------------------------+
+| NULL |
++--------------------------------+
+```
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]