This is an automated email from the ASF dual-hosted git repository.
morrysnow 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 c8c261fb600 [function] json_object support * as parameter (#3003)
c8c261fb600 is described below
commit c8c261fb6004c532a80d4ed5e1364af7a1ade748
Author: morrySnow <[email protected]>
AuthorDate: Fri Oct 24 10:54:22 2025 +0800
[function] json_object support * as parameter (#3003)
## Versions
- [x] dev
- [ ] 3.x
- [ ] 2.1
- [ ] 2.0
## Languages
- [x] Chinese
- [x] English
## Docs Checklist
- [x] Checked by AI
- [ ] Test Cases Built
---
.../scalar-functions/json-functions/json-object.md | 11 +++++++++++
.../scalar-functions/json-functions/json-object.md | 16 +++++++++++++---
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/json-functions/json-object.md
b/docs/sql-manual/sql-functions/scalar-functions/json-functions/json-object.md
index dac20fb48a8..2d02c995a57 100644
---
a/docs/sql-manual/sql-functions/scalar-functions/json-functions/json-object.md
+++
b/docs/sql-manual/sql-functions/scalar-functions/json-functions/json-object.md
@@ -15,10 +15,21 @@ Generate one JSON object containing specified Key-Value
pairs. Returns an error
JSON_OBJECT (<key>, <value>[, <key>, <value>, ...])
```
+```sql
+JSON_OBJECT(*)
+```
+
## Parameters
### Variable parameters:
- `<key>`: String type
- `<value>`: Multiple types, Doris will automatically convert non-JSON type
parameters to JSON type through the [`TO_JSON`](./to-json.md) function.
+- `*`: When invoked with an asterisk (wildcard), the OBJECT value is
constructed from the specified data using the attribute names as keys and the
associated values as values.
+
+ When you pass a wildcard to the function, you can qualify the wildcard
with the name or alias for the table. For example, to pass in all of the
columns from the table named mytable, specify the following:
+
+ ```sql
+ (mytable.*)
+ ```
## Notes
- The number of parameters must be even, can be 0 parameters (returns an empty
JSON object).
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-object.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-object.md
index 35da7e1fc78..12102094127 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-object.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-object.md
@@ -15,10 +15,20 @@
JSON_OBJECT (<key>, <value>[, <key>, <value>, ...])
```
+```sql
+JSON_OBJECT(*)
+```
+
## 参数
-### 可变参数:
-- <key> String 类型
-- <value> 多种类型,Doris 会自动将非 Json 类型的参数通过 [`TO_JSON`](./to-json.md) 函数将其转换为 Json
类型。
+- `<key>` String 类型
+- `<value>` 多种类型,Doris 会自动将非 Json 类型的参数通过 [`TO_JSON`](./to-json.md) 函数将其转换为
Json 类型。
+:`*` 当使用星号(通配符)调用时,会使用指定数据中的引用名成作为键(key),对应的值作为值(value),从而构造出一个 JSON 类型的值。
+
+ 当向该函数传入通配符时,可以用表的名称或别名对通配符进行限定。例如,若要传入名为 mytable 的表中的所有列,请按如下方式指定:
+
+ ```sql
+ (mytable.*)
+ ```
## 注意事项
- 参数数量必须为偶数个,可以是 0 个参数(返回一个空的 Json 对象)。
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]