Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ Returns a string. For each bit in `bits`, from the least significant bit to the
If `number_of_bits` is out of range [-2^31, 2^31 - 1] or any parameter in the function is NULL, return NULL.
## Example

<!-- setup-sql
CREATE TABLE test_export_set (`bits` BIGINT, `on` VARCHAR(20), `off` VARCHAR(20), `sep` VARCHAR(20), `num_of_b` INT) DISTRIBUTED BY HASH(`bits`) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_export_set VALUES (-1,'1','0',',',50),(-2,'1','0','',64),(5,'Y','N',',',5),(5,'1','0','',64),(5,'','0','',65),(6,'1','','',63),(19284249819,'1','0',',',64),(9,'apache','doris','|123|',64),(NULL,'1','0',',',5),(5,NULL,'0','',5),(5,'1',NULL,',',10),(5,'1','0',NULL,10),(5,'1','0',',',NULL);
-->

```sql
SELECT EXPORT_SET(-2, '1', '0');
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ EXPORT_SET(bits, on, off[, separator[, number_of_bits]])

## 举例

<!-- setup-sql
CREATE TABLE test_export_set (`bits` BIGINT, `on` VARCHAR(20), `off` VARCHAR(20), `sep` VARCHAR(20), `num_of_b` INT) DISTRIBUTED BY HASH(`bits`) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_export_set VALUES (-1,'1','0',',',50),(-2,'1','0','',64),(5,'Y','N',',',5),(5,'1','0','',64),(5,'','0','',65),(6,'1','','',63),(19284249819,'1','0',',',64),(9,'apache','doris','|123|',64),(NULL,'1','0',',',5),(5,NULL,'0','',5),(5,'1',NULL,',',10),(5,'1','0',NULL,10),(5,'1','0',',',NULL);
-->

```sql
SELECT EXPORT_SET(-2, '1', '0');
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/export-set.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-section-order

SQL function docs must contain sections in this order%3A Description%2C Syntax%2C Parameters%2C Return Value%2C Example. Missing%3A Example. Owner%3A @zclllyybb
{
"title": "EXPORT_SET",
"language": "zh-CN",
"description": "EXPORTSET 用于将一个整数的每一位(bit)转换为指定的字符串,并拼接成结果字符串。对于 bits 中每个为 1 的位,结果中对应位置会显示 on 字符串;每个为 0 的位则显示 off 字符串。位的检查顺序是从右到左(即从低位到高位),而拼接到结果字符串时是从左到右。"
}
---

Check warning on line 8 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/export-set.md

View workflow job for this annotation

GitHub Actions / Build Check

markdown-cjk-spacing

Chinese text should contain spaces around adjacent English words or numbers. Owner%3A @zclllyybb
## 描述

`EXPORT_SET` 用于将一个整数的每一位(bit)转换为指定的字符串,并拼接成结果字符串。对于 `bits` 中每个为 1 的位,结果中对应位置会显示 `on` 字符串;每个为 0 的位则显示 `off` 字符串。位的检查顺序是从右到左(即从低位到高位),而拼接到结果字符串时是从左到右。各位之间通过 `separator` 分隔(默认为逗号`,`)。

展示的位数由 `number_of_bits` 参数决定,默认展示 64 位。如果未指定或超出超出范围[0, 64]时自动按展示 64 位处理。

该函数行为与MySQL的[EXPORT_SET函数](https://dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_export-set) 一致。

Check notice on line 15 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/export-set.md

View workflow job for this annotation

GitHub Actions / Build Check

link-external-report-only

External link is report-only and was not fetched%3A https%3A//dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_export-set. Owner%3A @zclllyybb

Check warning on line 16 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/export-set.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-parameters-table

Parameters section must be a Markdown table with Parameter and Description columns. Owner%3A @zclllyybb
## 语法

```sql
Expand All @@ -23,7 +23,7 @@
## 参数

| 参数 | 说明 |
|-------------------|------|

Check warning on line 26 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/export-set.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-return-type

Return Value section must state the returned type. Owner%3A @zclllyybb
| `bits` | 用于转换的整数类型(LARGEINT)。若该值小于 -2^63 则按 -2^63 处理,若大于 2^64 - 1 则按 2^63 - 1 处理 |
| `on` | 指定 bit 为 1 时显示的字符串 |
| `off` | 指定 bit 为 0 时显示的字符串 |
Expand All @@ -39,6 +39,11 @@

## 举例

<!-- setup-sql
CREATE TABLE test_export_set (`bits` BIGINT, `on` VARCHAR(20), `off` VARCHAR(20), `sep` VARCHAR(20), `num_of_b` INT) DISTRIBUTED BY HASH(`bits`) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_export_set VALUES (-1,'1','0',',',50),(-2,'1','0','',64),(5,'Y','N',',',5),(5,'1','0','',64),(5,'','0','',65),(6,'1','','',63),(19284249819,'1','0',',',64),(9,'apache','doris','|123|',64),(NULL,'1','0',',',5),(5,NULL,'0','',5),(5,'1',NULL,',',10),(5,'1','0',NULL,10),(5,'1','0',',',NULL);
-->

```sql
SELECT EXPORT_SET(-2, '1', '0');
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/export-set.md

View workflow job for this annotation

GitHub Actions / Build Check

i18n-sync-locale-candidate

Japanese docs are report-only. Generate a candidate translation from the changed files and merge it only after human review. Owner%3A @zclllyybb

Check warning on line 1 in versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/export-set.md

View workflow job for this annotation

GitHub Actions / Build Check

i18n-sync-version-missing

English 4.x and current docs are strongly synchronized%2C but the current counterpart is missing. Add it or explain the version-specific exception in the PR description. Owner%3A @zclllyybb
{
"title": "EXPORT-SET",
"language": "en",
Expand All @@ -12,7 +12,7 @@

The number of bits displayed is determined by the `number_of_bits` parameter, with a default of 64 bits. If not specified or out of range (greater than 64), it is automatically treated as 64 bits.

This function behaves similarly to MySQL's [EXPORT_SET function](https://dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_export-set).

Check notice on line 15 in versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/export-set.md

View workflow job for this annotation

GitHub Actions / Build Check

link-external-report-only

External link is report-only and was not fetched%3A https%3A//dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_export-set. Owner%3A @zclllyybb

## Syntax

Expand All @@ -37,6 +37,11 @@
If `number_of_bits` is out of range [-2^31, 2^31 - 1] or any parameter in the function is NULL, return NULL.
## Example

<!-- setup-sql
CREATE TABLE test_export_set (`bits` BIGINT, `on` VARCHAR(20), `off` VARCHAR(20), `sep` VARCHAR(20), `num_of_b` INT) DISTRIBUTED BY HASH(`bits`) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_export_set VALUES (-1,'1','0',',',50),(-2,'1','0','',64),(5,'Y','N',',',5),(5,'1','0','',64),(5,'','0','',65),(6,'1','','',63),(19284249819,'1','0',',',64),(9,'apache','doris','|123|',64),(NULL,'1','0',',',5),(5,NULL,'0','',5),(5,'1',NULL,',',10),(5,'1','0',NULL,10),(5,'1','0',',',NULL);
-->

```sql
SELECT EXPORT_SET(-2, '1', '0');
```
Expand Down
Loading