Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement](docs) Sql function compress and uncompress #1955

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lzyy2024
Copy link

@lzyy2024 lzyy2024 commented Jan 27, 2025

Versions

  • dev
  • 3.0
  • 2.1
  • 2.0

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built


## Parameters

| 参数 | 说明 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there shouldn't be Chinese character in English docs

select compress('abc');
```
```text
+----------------------------------+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add case about empty string input

## Syntax

```sql
SELECT(<uncompressed>, <compressed>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems it's wrong? should be COMPRESS(<uncompressed_str>)?

## Syntax

```sql
UNCOMPRESS(<compressed>, <uncompressed>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong, uncompress only accept one arg

select uncompress(compress('abc'));
```
```text
+-----------------------------+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add more cases which got NULL, or empty

| 0x03000000789C4B4C4A0600024D0127 |
+----------------------------------+
```
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add sql here, and remove mysql>

```
mysql> select compress('');
```
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add text here

Copy link
Contributor

@zclllyybb zclllyybb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lzyy2024 lzyy2024 requested a review from zclllyybb February 6, 2025 16:04
``` sql
select compress('abc');
```
The result of the decompression is unreadable and you don't need to care about its true value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont comment like this. add a example like uncompress(compress())

## 语法

```sql
COMPRESS(<uncompresse_str>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有个拼写错误


## 返回值
返回串与输入的 <uncompressed_str> 类型一致
它是不可读的压缩字节流,你不应该获取它。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

尽量不要出现第一、第二人称

|--------------------|---------------|
| `<uncompressed_str>` | 未压缩的原串 |

参数类型是varchar或者string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个可以写到说明里

Copy link
Contributor

@zclllyybb zclllyybb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM



## Instructions
The parameter type is varchar or string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 这一行移动到 Parameters 的 Description 里
  2. 这一章节改名 Return Value

## Instructions
The parameter type is varchar or string

The return string is of the same type as the input <uncompressed_str>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The return string is of the same type as the input <uncompressed_str>
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 '' when the input is ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- <uncompressed_str> Return '' when the input is ''
- `<uncompressed_str>` Return empty string(`''`) when the input is empty string(`''`)

| `<compressed_str>` | Compressed binary data |


## Instructions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

和 compress 类似

@lzyy2024 lzyy2024 requested a review from morrySnow February 11, 2025 07:51
Comment on lines 40 to 42
| `<uncompressed_str>` | Uncompressed raw string |

The parameter type is varchar or string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `<uncompressed_str>` | Uncompressed raw string |
The parameter type is varchar or string
| `<uncompressed_str>` | Uncompressed raw string, parameter type is varchar or string |

@morrySnow morrySnow requested a review from KassieZ February 11, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants