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 6783a2ec29b [feat](sql-convertor) add some sql convertor variables
(#2432)
6783a2ec29b is described below
commit 6783a2ec29b922fc039769d002fcca9d5052ab15
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Tue Jun 3 14:11:08 2025 +0800
[feat](sql-convertor) add some sql convertor variables (#2432)
## Versions
- [x] dev
- [x] 3.0
- [ ] 2.1
- [ ] 2.0
## Languages
- [x] Chinese
- [x] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
---
.../sql-convertor/sql-convertor-overview.md | 20 ++++++--
.../sql-convertor/sql-convertor-overview.md | 20 ++++++--
.../version-3.0/lakehouse/sql-dialect.md | 56 ++++++++++++++++++++++
.../version-3.0/lakehouse/sql-dialect.md | 56 ++++++++++++++++++++++
4 files changed, 144 insertions(+), 8 deletions(-)
diff --git a/docs/lakehouse/sql-convertor/sql-convertor-overview.md
b/docs/lakehouse/sql-convertor/sql-convertor-overview.md
index 88107b99e0a..e0bf5332bc6 100644
--- a/docs/lakehouse/sql-convertor/sql-convertor-overview.md
+++ b/docs/lakehouse/sql-convertor/sql-convertor-overview.md
@@ -158,10 +158,6 @@ ORDER BY id;
+---------------------+-----------+-----------+------------+------+---------------------+-------------+------+------+---------------------+
```
-## Release Notes
-
-[SQL Convertor Release
Notes](https://docs.selectdb.com/docs/ecosystem/sql-converter/sql-converter-release-node)
-
## Serde Dialect
Different systems may have different display methods for different column
types.
@@ -206,3 +202,19 @@ The following table shows how various data types are
displayed in different seri
| `Map<int, null>` | `{1:null, 2:null}` | `{1:null,2:null}` | `{1=NULL,
2=NULL}` |
| `Struct<>` | Same as map | Same as map | Same as map | Same as map | |
+## Configurations
+
+- Variables
+
+ | Variable name | Example | Description |
+ | --- | --- | --- |
+ | `sql_converter_service_url` | `set global sql_converter_service_url =
"http://127.0.0.1:5001/api/v1/convert"` | Global variable, used to specify the
sql converter service address |
+ | `sql_dialect` | `set sql_dialect=presto` | Session variable, used to
specify the dialect of the current session |
+ | `serde_dialect` | `set serde_dialect=hive` | Session variable, used to
specify the serialization dialect format of the current session |
+ | `enable_sql_convertor_features` | `set
enable_sql_convertor_features="ctas"` | Session variable, user-specified to
enable certain special features of sql converter. `ctas`: Allows conversion of
the `SELECT` part of a `CTAS` statement. (This variable is supported since
Doris 3.0.7 and SQL Convertor 1.0.8.10)|
+ | `sql_convertor_config` | `set sql_convertor_config = '{"ignore_udf":
["func1", "func2", "fucn3"]}'` | Session variable used to specify that SQL
Convertor ignore some UDFs. SQL Convertor will not convert the functions in the
list, otherwise it may report an error "Unknown Function". (This variable is
supported since Doris 3.0.7 and SQL Convertor 1.0.8.10)|
+
+## Release Notes
+
+[SQL Convertor Release
Notes](https://docs.selectdb.com/docs/ecosystem/sql-converter/sql-converter-release-node)
+
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/sql-convertor/sql-convertor-overview.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/sql-convertor/sql-convertor-overview.md
index ae3639eb6d0..6084a6021a2 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/sql-convertor/sql-convertor-overview.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/sql-convertor/sql-convertor-overview.md
@@ -158,10 +158,6 @@ ORDER BY id;
+---------------------+-----------+-----------+------------+------+---------------------+-------------+------+------+---------------------+
```
-## 版本变更记录
-
-[SQL Convertor
版本变更记录](https://docs.selectdb.com/docs/ecosystem/sql-converter/sql-converter-release-node)
-
## 方言序列化
不同系统针对不同的列类型可能有不同的显示方式。
@@ -206,3 +202,19 @@ SET serde_diactor=<dialect>;
| `Map<int, null>` | `{1:null, 2:null}` | `{1:null,2:null}` | `{1=NULL,
2=NULL}` |
| `Struct<>` | Same as map | Same as map | Same as map | Same as map | |
+## 相关参数
+
+- 变量
+
+ | 变量名 | 示例 | 说明 |
+ | --- | --- | --- |
+ | `sql_converter_service_url` | `set global sql_converter_service_url =
"http://127.0.0.1:5001/api/v1/convert"` | 全局变量,用于指定 sql convetor 服务地址 |
+ | `sql_dialect` | `set sql_dialect=presto` | 会话变量,用于指定当前会话的方言 |
+ | `serde_dialect` | `set serde_dialect=hive` | 会话变量,用于指定当前会话的序列化方言格式 |
+ | `enable_sql_convertor_features` | `set
enable_sql_convertor_features="ctas"` | 会话变量,用户指定开启 sql convertor
的某些特殊功能。`ctas`: 允许对 `CTAS` 语句中的 `SELECT` 部分进行转换。(该参数自 Doris 3.0.7 和 SQL
Convertor 1.0.8.10 支持)|
+ | `sql_convertor_config` | `set sql_convertor_config = '{"ignore_udf":
["func1", "func2", "fucn3"]}'` | 会话变量,用于指定 SQL Convertor 忽略一些 UDF。在列表中的函数,SQL
Convertor 不会进行转换,否则可能报错 "Unknown Function" (该参数自 Doris 3.0.7 和 SQL Convertor
1.0.8.10 支持)|
+
+## 版本变更记录
+
+[SQL Convertor
版本变更记录](https://docs.selectdb.com/docs/ecosystem/sql-converter/sql-converter-release-node)
+
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/lakehouse/sql-dialect.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/lakehouse/sql-dialect.md
index 93cf19ce1af..d7132fde615 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/lakehouse/sql-dialect.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/lakehouse/sql-dialect.md
@@ -169,3 +169,59 @@ mysql> select toString(start_time) as col1,
1 row in set (0.02 sec)
```
+## 方言序列化
+
+不同系统针对不同的列类型可能有不同的显示方式。
+
+比如对于 NULL 值,Doris 和 Hive 显示为 `null`,而 Trino/Presto 显示为 `NULL`。
+
+对于 Map 类型,Hive 显示为 `{1:null,2:null}`,而 Trino/Presto 显示为 {1=NULL, 2=NULL}。
+
+为了最大程度保证用户迁移的行为一致性,Doris 提供了方言序列化模式选项,可以根据不同模式,返回不同的显示格式。
+
+```
+SET serde_diactor=<dialect>;
+```
+
+目前支持的序列化模式类型包括:
+
+- doris(默认)
+- hive
+- presto/trino
+
+> 注:该功能自 3.0.6 版本支持。
+
+### 序列化格式对照表
+
+以下表格显示了不同序列化模式下,各种数据类型的显示方式。未列举的类型表示显示方式一样。
+
+| Type | Doris | Hive | Presto/Trino |
+| --- | --- | --- | --- |
+| `Bool` | `1`, `0` | `1`, `0` | `1`, `0` |
+| `Integer` | `1`, `1000` | `1`, `1000` | `1`, `1000` |
+| `Float/Decimal` | `1.2`, `3.00` | `1.2`, `3.00` | `1.2`, `3.00` |
+| `Date/Datetime` | `2025-01-01`, `2025-01-01 10:11:11` | `2025-01-01`,
`2025-01-01 10:11:11` | `2025-01-01`, `2025-01-01 10:11:11` |
+| `String` | `abc`, `中国` | `abc`, `中国` | `abc`, `中国` |
+| `Null` | `null` | `null` | `NULL` |
+| `Array<bool>` | `[1, 0]` | `[true,false]` | `[1, 0]` |
+| `Array<int>` | `[1, 1000]` | `[1,1000]` | `[1, 1000]` |
+| `Array<string>` | `["abc", "中国"]` | `["abc","中国"]` | `["abc", "中国"]` |
+| `Array<date/datetime>` | `["2025-01-01", "2025-01-01 10:11:11"]` |
`["2025-01-01","2025-01-01 10:11:11"]` | `["2025-01-01", "2025-01-01
10:11:11"]` |
+| `Array<null>` | `[null]` | `[null]` | `[NULL]` |
+| `Map<int, string>` | `{1:"abc", 2:"中国"}` |`{1:"abc",2:"中国"}` |`{1=abc,
2=中国}` |
+| `Map<string, date/datetime>` | `{"k1":"2022-10-01", "k2":"2022-10-01
10:10:10"}` | `{"k1":"2022-10-01","k2":"2022-10-01 10:10:10"}` |
`{k1=2022-10-01, k2=2022-10-01 10:10:10}` |
+| `Map<int, null>` | `{1:null, 2:null}` | `{1:null,2:null}` | `{1=NULL,
2=NULL}` |
+| `Struct<>` | Same as map | Same as map | Same as map | Same as map | |
+
+## 相关参数
+
+- 变量
+
+ | 变量名 | 示例 | 说明 |
+ | --- | --- | --- |
+ | `sql_converter_service_url` | `set global sql_converter_service_url =
"http://127.0.0.1:5001/api/v1/convert"` | 全局变量,用于指定 sql convetor 服务地址 |
+ | `sql_dialect` | `set sql_dialect=presto` | 会话变量,用于指定当前会话的方言 |
+ | `serde_dialect` | `set serde_dialect=hive` | 会话变量,用于指定当前会话的序列化方言格式 |
+ | `enable_sql_convertor_features` | `set
enable_sql_convertor_features="ctas"` | 会话变量,用户指定开启 sql convertor
的某些特殊功能。`ctas`: 允许对 `CTAS` 语句中的 `SELECT` 部分进行转换。(该参数自 Doris 3.0.7 和 SQL
Convertor 1.0.8.10 支持)|
+ | `sql_convertor_config` | `set sql_convertor_config = '{"ignore_udf":
["func1", "func2", "fucn3"]}'` | 会话变量,用于指定 SQL Convertor 忽略一些 UDF。在列表中的函数,SQL
Convertor 不会进行转换,否则可能报错 "Unknown Function" (该参数自 Doris 3.0.7 和 SQL Convertor
1.0.8.10 支持)|
+
diff --git a/versioned_docs/version-3.0/lakehouse/sql-dialect.md
b/versioned_docs/version-3.0/lakehouse/sql-dialect.md
index 3dc6b2f6e30..2aa0c3e816d 100644
--- a/versioned_docs/version-3.0/lakehouse/sql-dialect.md
+++ b/versioned_docs/version-3.0/lakehouse/sql-dialect.md
@@ -163,3 +163,59 @@ mysql> select toString(start_time) as col1,
1 row in set (0.02 sec)
```
+## Serde Dialect
+
+Different systems may have different display methods for different column
types.
+
+For example, for NULL values, Doris and Hive display as `null`, while
Trino/Presto displays as `NULL`.
+
+For Map types, Hive displays as `{1:null,2:null}`, while Trino/Presto displays
as {1=NULL, 2=NULL}.
+
+In order to ensure the consistency of user migration behavior to the greatest
extent, Doris provides a dialect serialization mode option, which can return
different display formats according to different modes.
+
+```
+SET serde_diactor=<dialect>;
+```
+
+Currently supported serialization mode types include:
+
+- doris (default)
+- hive
+- presto/trino
+
+> Note: This feature has been supported since version 3.0.6.
+
+### Serde Comparison Table
+
+The following table shows how various data types are displayed in different
serialization modes. Types not listed have the same display method.
+
+| Type | Doris | Hive | Presto/Trino |
+| --- | --- | --- | --- |
+| `Bool` | `1`, `0` | `1`, `0` | `1`, `0` |
+| `Integer` | `1`, `1000` | `1`, `1000` | `1`, `1000` |
+| `Float/Decimal` | `1.2`, `3.00` | `1.2`, `3.00` | `1.2`, `3.00` |
+| `Date/Datetime` | `2025-01-01`, `2025-01-01 10:11:11` | `2025-01-01`,
`2025-01-01 10:11:11` | `2025-01-01`, `2025-01-01 10:11:11` |
+| `String` | `abc`, `中国` | `abc`, `中国` | `abc`, `中国` |
+| `Null` | `null` | `null` | `NULL` |
+| `Array<bool>` | `[1, 0]` | `[true,false]` | `[1, 0]` |
+| `Array<int>` | `[1, 1000]` | `[1,1000]` | `[1, 1000]` |
+| `Array<string>` | `["abc", "中国"]` | `["abc","中国"]` | `["abc", "中国"]` |
+| `Array<date/datetime>` | `["2025-01-01", "2025-01-01 10:11:11"]` |
`["2025-01-01","2025-01-01 10:11:11"]` | `["2025-01-01", "2025-01-01
10:11:11"]` |
+| `Array<null>` | `[null]` | `[null]` | `[NULL]` |
+| `Map<int, string>` | `{1:"abc", 2:"中国"}` |`{1:"abc",2:"中国"}` |`{1=abc,
2=中国}` |
+| `Map<string, date/datetime>` | `{"k1":"2022-10-01", "k2":"2022-10-01
10:10:10"}` | `{"k1":"2022-10-01","k2":"2022-10-01 10:10:10"}` |
`{k1=2022-10-01, k2=2022-10-01 10:10:10}` |
+| `Map<int, null>` | `{1:null, 2:null}` | `{1:null,2:null}` | `{1=NULL,
2=NULL}` |
+| `Struct<>` | Same as map | Same as map | Same as map | Same as map | |
+
+## Configurations
+
+- Variables
+
+ | Variable name | Example | Description |
+ | --- | --- | --- |
+ | `sql_converter_service_url` | `set global sql_converter_service_url =
"http://127.0.0.1:5001/api/v1/convert"` | Global variable, used to specify the
sql converter service address |
+ | `sql_dialect` | `set sql_dialect=presto` | Session variable, used to
specify the dialect of the current session |
+ | `serde_dialect` | `set serde_dialect=hive` | Session variable, used to
specify the serialization dialect format of the current session |
+ | `enable_sql_convertor_features` | `set
enable_sql_convertor_features="ctas"` | Session variable, user-specified to
enable certain special features of sql converter. `ctas`: Allows conversion of
the `SELECT` part of a `CTAS` statement. (This variable is supported since
Doris 3.0.7 and SQL Convertor 1.0.8.10)|
+ | `sql_convertor_config` | `set sql_convertor_config = '{"ignore_udf":
["func1", "func2", "fucn3"]}'` | Session variable used to specify that SQL
Convertor ignore some UDFs. SQL Convertor will not convert the functions in the
list, otherwise it may report an error "Unknown Function". (This variable is
supported since Doris 3.0.7 and SQL Convertor 1.0.8.10)|
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]