This is an automated email from the ASF dual-hosted git repository.
CalvinKirs 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 362d727022f [doc] Fix create-function format (#4103)
362d727022f is described below
commit 362d727022fd4b97f22d55344bdc54f86114e4df
Author: linrrarity <[email protected]>
AuthorDate: Fri Sep 4 21:43:33 2026 +0800
[doc] Fix create-function format (#4103)
## Versions
- [x] dev
- [x] 4.x
- [ ] 3.x
- [ ] 2.1 or older (not covered by version/language sync gate)
## Languages
- [x] Chinese
- [x] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
- [ ] Updated required version and language counterparts, or explained
why not
- [ ] If only one language changed, confirmed whether source/translation
counterparts need sync
---
.../sql-statements/function/CREATE-FUNCTION.md | 20 ++++++++++----------
.../sql-statements/function/CREATE-FUNCTION.md | 20 ++++++++++----------
.../sql-statements/function/CREATE-FUNCTION.md | 20 ++++++++++----------
.../sql-statements/function/CREATE-FUNCTION.md | 20 ++++++++++----------
4 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/docs/sql-manual/sql-statements/function/CREATE-FUNCTION.md
b/docs/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index 095fbf35099..e60bdad51a9 100644
--- a/docs/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++ b/docs/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -31,7 +31,7 @@ CREATE [ GLOBAL ]
**2. `<arg_type>`**
-> The input parameter type of the function. For variable-length parameters,
use `, ...` to indicate them. If it is a variable-length type, the type of the
variable-length parameters must be consistent with the type of the last
non-variable-length parameter.
+> The input parameter types of the function. One or more fixed arguments can
be declared. **Starting from version 4.1.5, declaring variadic functions with
`...` is no longer supported. To accept a variable number of values, use an
`ARRAY` parameter instead.**
**3. `<ret_type>`**
@@ -160,10 +160,10 @@ To execute this command, the user must have `ADMIN_PRIV`
privileges.
"volatility" = "volatile"
)
AS $$
-import uuid
-def py_uuid_token_impl(x):
- return f"{x}-{uuid.uuid4()}"
-$$;
+ import uuid
+ def py_uuid_token_impl(x):
+ return f"{x}-{uuid.uuid4()}"
+ $$;
SET enable_cte_materialize = true;
SET inline_cte_referenced_threshold = 10;
@@ -200,10 +200,10 @@ $$;
"volatility" = "immutable"
)
AS $$
-import uuid
-def py_uuid_token_impl(x):
- return f"{x}-{uuid.uuid4()}"
-$$;
+ import uuid
+ def py_uuid_token_impl(x):
+ return f"{x}-{uuid.uuid4()}"
+ $$;
```
Run the same query again:
@@ -228,4 +228,4 @@ $$;
```
Why this is wrong:
- Because `py_uuid_token` is volatile, each call to `uuid.uuid4()` generates
a new value. If the function is incorrectly marked as `volatility = immutable`,
the optimizer may treat repeated references as safe to rewrite and may choose a
plan that evaluates the UDF separately on both sides of `UNION ALL`. As a
result, the same `id` can produce two different `token` values, and
`COUNT(DISTINCT token)` changes from `1` to `2`.
\ No newline at end of file
+ Because `py_uuid_token` is volatile, each call to `uuid.uuid4()` generates
a new value. If the function is incorrectly marked as `volatility = immutable`,
the optimizer may treat repeated references as safe to rewrite and may choose a
plan that evaluates the UDF separately on both sides of `UNION ALL`. As a
result, the same `id` can produce two different `token` values, and
`COUNT(DISTINCT token)` changes from `1` to `2`.
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/function/CREATE-FUNCTION.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index 3e222218bd7..be8ef735044 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -30,7 +30,7 @@ CREATE [ GLOBAL ]
**2. `<arg_type>`**
-> 函数的输入参数类型。变长参数时可以使用`, ...`来表示,如果是变长类型,那么变长部分参数的类型与最后一个非变长参数类型一致。
+> 函数的输入参数类型,可以声明一个或多个固定参数。**自 4.1.5 版本起,不再支持使用 `...` 声明可变参数函数。如需接收数量不定的参数,请改用
`ARRAY` 类型参数。**
**3. `<ret_type>`**
@@ -149,10 +149,10 @@ CREATE [ GLOBAL ]
"volatility" = "volatile"
)
AS $$
-import uuid
-def py_uuid_token_impl(x):
- return f"{x}-{uuid.uuid4()}"
-$$;
+ import uuid
+ def py_uuid_token_impl(x):
+ return f"{x}-{uuid.uuid4()}"
+ $$;
SET enable_cte_materialize = true;
SET inline_cte_referenced_threshold = 10;
@@ -189,10 +189,10 @@ $$;
"volatility" = "immutable"
)
AS $$
-import uuid
-def py_uuid_token_impl(x):
- return f"{x}-{uuid.uuid4()}"
-$$;
+ import uuid
+ def py_uuid_token_impl(x):
+ return f"{x}-{uuid.uuid4()}"
+ $$;
```
重新执行同一条查询:
@@ -217,4 +217,4 @@ $$;
```
错误原因:
- `py_uuid_token` 是 volatile 函数,`uuid.uuid4()` 每次调用都会生成新值。如果错误地将它标记为
`volatility = immutable`,优化器可能会把重复引用视为可安全改写,并选择在 `UNION ALL` 两侧分别执行 UDF
的计划。这样同一个 `id` 会生成两个不同的 `token`,`COUNT(DISTINCT token)` 就会从 `1` 变成 `2`。
\ No newline at end of file
+ `py_uuid_token` 是 volatile 函数,`uuid.uuid4()` 每次调用都会生成新值。如果错误地将它标记为
`volatility = immutable`,优化器可能会把重复引用视为可安全改写,并选择在 `UNION ALL` 两侧分别执行 UDF
的计划。这样同一个 `id` 会生成两个不同的 `token`,`COUNT(DISTINCT token)` 就会从 `1` 变成 `2`。
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/function/CREATE-FUNCTION.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index c7f95c64bde..39f2dcdf9ee 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -30,7 +30,7 @@ CREATE [ GLOBAL ]
**2. `<arg_type>`**
-> 函数的输入参数类型。变长参数时可以使用`, ...`来表示,如果是变长类型,那么变长部分参数的类型与最后一个非变长参数类型一致。
+> 函数的输入参数类型,可以声明一个或多个固定参数。**自 4.1.5 版本起,不再支持使用 `...` 声明可变参数函数。如需接收数量不定的参数,请改用
`ARRAY` 类型参数。**
**3. `<ret_type>`**
@@ -149,10 +149,10 @@ CREATE [ GLOBAL ]
"volatility" = "volatile"
)
AS $$
-import uuid
-def py_uuid_token_impl(x):
- return f"{x}-{uuid.uuid4()}"
-$$;
+ import uuid
+ def py_uuid_token_impl(x):
+ return f"{x}-{uuid.uuid4()}"
+ $$;
SET enable_cte_materialize = true;
SET inline_cte_referenced_threshold = 10;
@@ -189,10 +189,10 @@ $$;
"volatility" = "immutable"
)
AS $$
-import uuid
-def py_uuid_token_impl(x):
- return f"{x}-{uuid.uuid4()}"
-$$;
+ import uuid
+ def py_uuid_token_impl(x):
+ return f"{x}-{uuid.uuid4()}"
+ $$;
```
重新执行同一条查询:
@@ -217,4 +217,4 @@ $$;
```
错误原因:
- `py_uuid_token` 是 volatile 函数,`uuid.uuid4()` 每次调用都会生成新值。如果错误地将它标记为
`volatility = immutable`,优化器可能会把重复引用视为可安全改写,并选择在 `UNION ALL` 两侧分别执行 UDF
的计划。这样同一个 `id` 会生成两个不同的 `token`,`COUNT(DISTINCT token)` 就会从 `1` 变成 `2`。
\ No newline at end of file
+ `py_uuid_token` 是 volatile 函数,`uuid.uuid4()` 每次调用都会生成新值。如果错误地将它标记为
`volatility = immutable`,优化器可能会把重复引用视为可安全改写,并选择在 `UNION ALL` 两侧分别执行 UDF
的计划。这样同一个 `id` 会生成两个不同的 `token`,`COUNT(DISTINCT token)` 就会从 `1` 变成 `2`。
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-statements/function/CREATE-FUNCTION.md
b/versioned_docs/version-4.x/sql-manual/sql-statements/function/CREATE-FUNCTION.md
index 68e9e5f77b1..4b9ac4737c7 100644
---
a/versioned_docs/version-4.x/sql-manual/sql-statements/function/CREATE-FUNCTION.md
+++
b/versioned_docs/version-4.x/sql-manual/sql-statements/function/CREATE-FUNCTION.md
@@ -31,7 +31,7 @@ CREATE [ GLOBAL ]
**2. `<arg_type>`**
-> The input parameter type of the function. For variable-length parameters,
use `, ...` to indicate them. If it is a variable-length type, the type of the
variable-length parameters must be consistent with the type of the last
non-variable-length parameter.
+> The input parameter types of the function. One or more fixed arguments can
be declared. **Starting from version 4.1.5, declaring variadic functions with
`...` is no longer supported. To accept a variable number of values, use an
`ARRAY` parameter instead.**
**3. `<ret_type>`**
@@ -160,10 +160,10 @@ To execute this command, the user must have `ADMIN_PRIV`
privileges.
"volatility" = "volatile"
)
AS $$
-import uuid
-def py_uuid_token_impl(x):
- return f"{x}-{uuid.uuid4()}"
-$$;
+ import uuid
+ def py_uuid_token_impl(x):
+ return f"{x}-{uuid.uuid4()}"
+ $$;
SET enable_cte_materialize = true;
SET inline_cte_referenced_threshold = 10;
@@ -200,10 +200,10 @@ $$;
"volatility" = "immutable"
)
AS $$
-import uuid
-def py_uuid_token_impl(x):
- return f"{x}-{uuid.uuid4()}"
-$$;
+ import uuid
+ def py_uuid_token_impl(x):
+ return f"{x}-{uuid.uuid4()}"
+ $$;
```
Run the same query again:
@@ -228,4 +228,4 @@ $$;
```
Why this is wrong:
- Because `py_uuid_token` is volatile, each call to `uuid.uuid4()` generates
a new value. If the function is incorrectly marked as `volatility = immutable`,
the optimizer may treat repeated references as safe to rewrite and may choose a
plan that evaluates the UDF separately on both sides of `UNION ALL`. As a
result, the same `id` can produce two different `token` values, and
`COUNT(DISTINCT token)` changes from `1` to `2`.
\ No newline at end of file
+ Because `py_uuid_token` is volatile, each call to `uuid.uuid4()` generates
a new value. If the function is incorrectly marked as `volatility = immutable`,
the optimizer may treat repeated references as safe to rewrite and may choose a
plan that evaluates the UDF separately on both sides of `UNION ALL`. As a
result, the same `id` can produce two different `token` values, and
`COUNT(DISTINCT token)` changes from `1` to `2`.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]