From b3344b549a031cfe25ccd3f6dffa75bb48b4bfbd Mon Sep 17 00:00:00 2001 From: "Mingyu Chen (Rayner)" Date: Wed, 9 Jul 2025 07:59:01 -0700 Subject: [PATCH] [opt](sql-convertor) add multi url --- docs/lakehouse/sql-convertor/sql-convertor-overview.md | 10 ++++++++++ .../lakehouse/sql-convertor/sql-convertor-overview.md | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/docs/lakehouse/sql-convertor/sql-convertor-overview.md b/docs/lakehouse/sql-convertor/sql-convertor-overview.md index c07ff9030165f..f7a1e09d0a9c2 100644 --- a/docs/lakehouse/sql-convertor/sql-convertor-overview.md +++ b/docs/lakehouse/sql-convertor/sql-convertor-overview.md @@ -55,6 +55,8 @@ This feature is currently experimental. If you encounter any issues during use, - `127.0.0.1:5001` is the IP and port of the SQL dialect conversion service deployment node. + - Starting from version 3.0.7, you can set multiple URL addresses to provide high availability for SQL dialect conversion services. See the **Related Parameters** section for details. + ## Use SQL Dialects Currently supported dialect types include: @@ -195,6 +197,14 @@ The following table shows how various data types are displayed in different seri | `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.6 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.6 and SQL Convertor 1.0.8.10)| + Starting from version 3.0.7, you can set multiple URL addresses separated by commas: + + ``` + set global sql_converter_service_url = "http://127.0.0.1:5001/api/v1/convert,http://127.0.0.2:5001/api/v1/convert" + ``` + + Doris will prioritize the local service address `127.0.0.1`. When the preferred address is unavailable, it will automatically switch to other available addresses to ensure service availability. + ## Best Practices - Specify functions that do not need to be converted 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 14a2ce55e1560..72ea69c2b09fa 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 @@ -55,6 +55,8 @@ - `127.0.0.1:5001` 是 SQL 方言转换服务的部署节点 ip 和端口。 + - 自 3.0.7 版本开始,允许设置多个 url 地址,已提供高可用的 SQL 方言转换服务。详见 **相关参数** 部分介绍。 + ## 使用 SQL 方言 目前支持的方言类型包括: @@ -195,6 +197,14 @@ SET serde_diactor=; | `enable_sql_convertor_features` | `set enable_sql_convertor_features="ctas"` | 会话变量,用户指定开启 sql convertor 的某些特殊功能。`ctas`: 允许对 `CTAS` 语句中的 `SELECT` 部分进行转换。(该参数自 Doris 3.0.6 和 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.6 和 SQL Convertor 1.0.8.10 支持)| + 自 3.0.7 版本开始,允许设置多个 url 地址,以逗号分隔: + + ``` + set global sql_converter_service_url = "http://127.0.0.1:5001/api/v1/convert,"http://127.0.0.2:5001/api/v1/convert"" + ``` + + Doris 会优先选择 `127.0.0.1` 的本地服务地址,当优先选择的地址不可用时,会自动切换到其他可用地址,以保证服务的可用性。 + ## 最佳实践 - 指定不需要转换的函数