This is an automated email from the ASF dual-hosted git repository.
kassiez 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 77294ebcfc9 [Enhancement](docs) Sql function compress and uncompress
(#1955)
77294ebcfc9 is described below
commit 77294ebcfc91fc9679082398b6e11a705f48f3ef
Author: lzyy2024 <[email protected]>
AuthorDate: Wed Feb 12 16:49:43 2025 +0800
[Enhancement](docs) Sql function compress and uncompress (#1955)
## Versions
- [x] dev
- [ ] 3.0
- [ ] 2.1
- [ ] 2.0
## Languages
- [x] Chinese
- [x] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
---
.../scalar-functions/string-functions/compress.md | 73 +++++++++++++++++++
.../string-functions/uncompress.md | 81 ++++++++++++++++++++++
.../scalar-functions/string-functions/compress.md | 73 +++++++++++++++++++
.../string-functions/uncompress.md | 81 ++++++++++++++++++++++
sidebars.json | 2 +
5 files changed, 310 insertions(+)
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/string-functions/compress.md
b/docs/sql-manual/sql-functions/scalar-functions/string-functions/compress.md
new file mode 100644
index 00000000000..f9a66aaf59b
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/string-functions/compress.md
@@ -0,0 +1,73 @@
+---
+{
+ "title": "COMPRESS",
+ "language": "en"
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+The COMPRESS function is used to compress strings or values into binary data.
The compressed data can be decompressed using the UNCOMPRESS function.
+
+## Syntax
+
+```sql
+COMPRESS(<uncompressed_str>)
+```
+
+## Parameters
+
+| Parameters | Description |
+|--------------------|---------------|
+| `<uncompressed_str>` | Uncompressed raw string, parameter type is varchar or
string |
+
+
+## Return Value
+
+The return string is of the same type as the input `uncompressed_str`
+
+The return string is an unreadable compressed byte stream.
+Special cases:
+- `uncompressed_str` Return empty string(`''`) when the input is empty
string(`''`)
+
+## Example
+
+``` sql
+select uncompress(compress('abc'));
+```
+```text
++-----------------------------+
+| uncompress(compress('abc')) |
++-----------------------------+
+| abc |
++-----------------------------+
+```
+
+```sql
+select compress('');
+```
+```text
++--------------+
+| compress('') |
++--------------+
+| |
++--------------+
+```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/string-functions/uncompress.md
b/docs/sql-manual/sql-functions/scalar-functions/string-functions/uncompress.md
new file mode 100644
index 00000000000..4c38f02fedc
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/string-functions/uncompress.md
@@ -0,0 +1,81 @@
+---
+{
+ "title": "UNCOMPRESS",
+ "language": "en"
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+The UNCOMPRESS function is used to COMPRESS binary data into strings or
values, you need to make sure that the binary data needs to be the result of
'compress'.
+
+## Syntax
+
+```sql
+UNCOMPRESS(<compressed_str>)
+```
+
+## Parameters
+
+| Parameters | Description |
+|--------------------|---------------|
+| `<compressed_str>` | Compressed binary data, parameter type is varchar or
string |
+
+
+## Return Value
+
+The return value is the same as the input `compressed_str` type
+
+Special cases:
+- `compressed_str` Returns NULL if the binary data is not compressed.
+
+## Example
+
+``` sql
+select uncompress(compress('abc'));
+```
+```text
++-----------------------------+
+| uncompress(compress('abc')) |
++-----------------------------+
+| abc |
++-----------------------------+
+```
+```sql
+select uncompress(compress(''));
+```
+```text
++--------------------------+
+| uncompress(compress('')) |
++--------------------------+
+| |
++--------------------------+
+```
+```sql
+select uncompress(compress(abc));
+```
+```text
++-------------------+
+| uncompress('abc') |
++-------------------+
+| NULL |
++-------------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/string-functions/compress.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/string-functions/compress.md
new file mode 100644
index 00000000000..11efe605015
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/string-functions/compress.md
@@ -0,0 +1,73 @@
+---
+{
+ "title": "COMPRESS",
+ "language": "zh-CN"
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## 描述
+COMPRESS 函数用于将字符串或值压缩成二进制数据,压缩后的数据可通过 `UNCOMPRESS` 函数解压还原。
+
+## 语法
+
+```sql
+COMPRESS(<uncompressed_str>)
+```
+
+## 参数
+
+| 参数 | 说明 |
+|--------------------|---------------|
+| `<uncompressed_str>` | 未压缩的原串, 参数类型是varchar或者string |
+
+## 返回值
+
+返回串与输入的 `uncompressed_str` 类型一致
+
+返回串是不可读的压缩字节流。
+
+特殊情况:
+- `uncompressed_str` 输入为 empty string(`''`) 时,返回 empty string(`''`)
+
+## 举例
+
+``` sql
+select uncompress(compress('abc'));
+```
+```text
++-----------------------------+
+| uncompress(compress('abc')) |
++-----------------------------+
+| abc |
++-----------------------------+
+```
+
+```sql
+select compress('');
+```
+```text
++--------------+
+| compress('') |
++--------------+
+| |
++--------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/string-functions/uncompress.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/string-functions/uncompress.md
new file mode 100644
index 00000000000..77410e41034
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/string-functions/uncompress.md
@@ -0,0 +1,81 @@
+---
+{
+ "title": "UNCOMPRESS",
+ "language": "zh-CN"
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## 描述
+UNCOMPRESS 函数用于将二进制数据解压缩成字符串或值,你需要确保二进制数据需要是`COMPRESS`的结果。
+
+## 语法
+
+```sql
+UNCOMPRESS(<compressed_str>)
+```
+
+## 参数
+
+| 参数 | 说明 |
+|--------------------|---------------|
+| `<compressed_str>` | 压缩得到的二进制数据, 参数类型是varchar或者string |
+
+## 返回值
+
+返回值与输入的 `compressed_str` 类型一致
+
+特殊情况:
+- `compressed_str` 输入不是`COMPRESS`得到的二进制数据时, 返回 NULL.
+
+
+## 举例
+
+``` sql
+select uncompress(compress('abc'));
+```
+```text
++-----------------------------+
+| uncompress(compress('abc')) |
++-----------------------------+
+| abc |
++-----------------------------+
+```
+```sql
+select uncompress(compress(''));
+```
+```text
++--------------------------+
+| uncompress(compress('')) |
++--------------------------+
+| |
++--------------------------+
+```
+```sql
+select uncompress(compress(abc));
+```
+```text
++-------------------+
+| uncompress('abc') |
++-------------------+
+| NULL |
++-------------------+
+```
\ No newline at end of file
diff --git a/sidebars.json b/sidebars.json
index de9ed801957..bef8ea0885f 100644
--- a/sidebars.json
+++ b/sidebars.json
@@ -945,11 +945,13 @@
"sql-manual/sql-functions/scalar-functions/string-functions/rpad",
"sql-manual/sql-functions/scalar-functions/string-functions/lcase",
"sql-manual/sql-functions/scalar-functions/string-functions/ucase",
+
"sql-manual/sql-functions/scalar-functions/string-functions/uncompress",
"sql-manual/sql-functions/scalar-functions/string-functions/initcap",
"sql-manual/sql-functions/scalar-functions/string-functions/repeat",
"sql-manual/sql-functions/scalar-functions/string-functions/reverse",
"sql-manual/sql-functions/scalar-functions/string-functions/char",
"sql-manual/sql-functions/scalar-functions/string-functions/concat",
+
"sql-manual/sql-functions/scalar-functions/string-functions/compress",
"sql-manual/sql-functions/scalar-functions/string-functions/concat-ws",
"sql-manual/sql-functions/scalar-functions/string-functions/substring",
"sql-manual/sql-functions/scalar-functions/string-functions/count_substrings",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]