This is an automated email from the ASF dual-hosted git repository.
csun5285 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 71885ecddaa [doc] restore json_object_flatten doc removed by #3660
(#3916)
71885ecddaa is described below
commit 71885ecddaa002d9301991028f5779def3d889f0
Author: Chenyang Sun <[email protected]>
AuthorDate: Sat Jun 6 19:16:32 2026 +0800
[doc] restore json_object_flatten doc removed by #3660 (#3916)
The json_object_flatten function docs were added in #3589 but were
accidentally deleted by the "online new home page" refactor in #3660,
which replaced the docs tree with the docs-next tree that predated the
function. As a result the page is missing from the live site.
Restore the EN/ZH pages for both current(dev) and version-4.x from the
original #3589 commit (8908f21b4) and re-register them in sidebars.ts
and version-4.x-sidebars.json.
## Versions
- [x] dev
- [x] 4.x
- [ ] 3.x
- [ ] 2.1 or older (not covered by version/language sync gate)
## Languages
- [x] Chinese
- [x] English
- [ ] Japanese candidate translation needed
## 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
---------
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
---
config/redirects-4.x.json | 8 --
.../json-functions/json-object-flatten.md | 155 +++++++++++++++++++++
.../json-functions/json-object-flatten.md | 155 +++++++++++++++++++++
.../json-functions/json-object-flatten.md | 155 +++++++++++++++++++++
sidebars.ts | 1 +
.../json-functions/json-object-flatten.md | 155 +++++++++++++++++++++
versioned_sidebars/version-4.x-sidebars.json | 1 +
7 files changed, 622 insertions(+), 8 deletions(-)
diff --git a/config/redirects-4.x.json b/config/redirects-4.x.json
index 08881f901b8..e5d16966cdb 100644
--- a/config/redirects-4.x.json
+++ b/config/redirects-4.x.json
@@ -711,14 +711,6 @@
"from":
"/zh-CN/docs/4.x/query-acceleration/tuning/tuning-plan/optimizing-join-with-colocate-group",
"to": "/zh-CN/docs/4.x/getting-started/what-is-apache-doris"
},
- {
- "from":
"/docs/4.x/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten",
- "to": "/docs/4.x/getting-started/what-is-apache-doris"
- },
- {
- "from":
"/zh-CN/docs/4.x/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten",
- "to": "/zh-CN/docs/4.x/getting-started/what-is-apache-doris"
- },
{
"from": "/docs/4.x/table-design/best-practice",
"to": "/docs/4.x/getting-started/what-is-apache-doris"
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
b/docs/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
new file mode 100644
index 00000000000..607926ebb9a
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
@@ -0,0 +1,155 @@
+---
+{
+ "title": "JSON_OBJECT_FLATTEN",
+ "language": "en",
+ "description": "JSON_OBJECT_FLATTEN flattens a nested JSON object into a
single-level object whose keys are dot-joined paths to each leaf value."
+}
+---
+
+## Description
+
+`JSON_OBJECT_FLATTEN` flattens a nested JSON object into a single-level JSON
object whose keys are the dot-joined paths to each leaf value. It follows the
NiFi FlattenJson "keep-arrays" semantics: only objects are recursively walked,
while arrays, scalars, nulls, and empty objects are kept as opaque leaf values.
+
+If the top-level input is not an object (for example, a scalar, an array, or
`null`), it is returned unchanged.
+
+## Syntax
+
+```sql
+JSON_OBJECT_FLATTEN(<json_value>)
+```
+
+## Parameters
+
+**`<json_value>`** - The JSON value to flatten. Must be of JSON type.
+
+## Return Value
+
+Returns a JSON value:
+
+- If the input is a nested JSON object, returns a single-level JSON object
whose keys are the dot-joined paths to each leaf value.
+- If the input is not an object (scalar, array, or null), returns the input
unchanged.
+- If the input is `NULL`, returns `NULL`.
+
+## Examples
+
+### Basic nested object flattening
+
+```sql
+SELECT json_object_flatten('{"a":{"b":2}}');
+```
+
+```text
++--------------------------------------+
+| json_object_flatten('{"a":{"b":2}}') |
++--------------------------------------+
+| {"a.b":2} |
++--------------------------------------+
+```
+
+### Deeply nested object
+
+```sql
+SELECT json_object_flatten('{"a":{"b":{"c":3}}}');
+```
+
+```text
++--------------------------------------------+
+| json_object_flatten('{"a":{"b":{"c":3}}}') |
++--------------------------------------------+
+| {"a.b.c":3} |
++--------------------------------------------+
+```
+
+### Already-flat object
+
+```sql
+SELECT json_object_flatten('{"a":1,"b":"hi"}');
+```
+
+```text
++-----------------------------------------+
+| json_object_flatten('{"a":1,"b":"hi"}') |
++-----------------------------------------+
+| {"a":1,"b":"hi"} |
++-----------------------------------------+
+```
+
+### Arrays preserved as opaque leaves
+
+```sql
+SELECT json_object_flatten('{"a":[{"b":1},{"b":2}]}');
+```
+
+```text
++------------------------------------------------+
+| json_object_flatten('{"a":[{"b":1},{"b":2}]}') |
++------------------------------------------------+
+| {"a":[{"b":1},{"b":2}]} |
++------------------------------------------------+
+```
+
+```sql
+SELECT json_object_flatten('{"a":{"b":[1,2,3]}}');
+```
+
+```text
++--------------------------------------------+
+| json_object_flatten('{"a":{"b":[1,2,3]}}') |
++--------------------------------------------+
+| {"a.b":[1,2,3]} |
++--------------------------------------------+
+```
+
+### Top-level non-object values pass through unchanged
+
+```sql
+SELECT json_object_flatten('42');
+```
+
+```text
++---------------------------+
+| json_object_flatten('42') |
++---------------------------+
+| 42 |
++---------------------------+
+```
+
+```sql
+SELECT json_object_flatten('[1,2,{"x":3}]');
+```
+
+```text
++--------------------------------------+
+| json_object_flatten('[1,2,{"x":3}]') |
++--------------------------------------+
+| [1,2,{"x":3}] |
++--------------------------------------+
+```
+
+### NULL input
+
+```sql
+SELECT json_object_flatten(NULL);
+```
+
+```text
++---------------------------+
+| json_object_flatten(NULL) |
++---------------------------+
+| NULL |
++---------------------------+
+```
+
+### Mixed nested object with scalars, arrays, and sub-objects
+
+```sql
+SELECT json_object_flatten('{"x":{"s":1,"a":[1,2],"o":{"k":"v"}}}');
+```
+
+```text
++--------------------------------------------------------------+
+| json_object_flatten('{"x":{"s":1,"a":[1,2],"o":{"k":"v"}}}') |
++--------------------------------------------------------------+
+| {"x.s":1,"x.a":[1,2],"x.o.k":"v"} |
++--------------------------------------------------------------+
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
new file mode 100644
index 00000000000..59a1467941d
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
@@ -0,0 +1,155 @@
+---
+{
+ "title": "JSON_OBJECT_FLATTEN",
+ "language": "zh-CN",
+ "description": "JSON_OBJECT_FLATTEN 将嵌套的 JSON 对象展平为单层 JSON
对象,其键为指向每个叶子值的点连接路径。"
+}
+---
+
+## 描述
+
+`JSON_OBJECT_FLATTEN` 函数将嵌套的 JSON 对象展平为一个单层 JSON
对象,其键是指向每个叶子值的点(`.`)连接路径。该函数遵循 NiFi FlattenJson 的 "keep-arrays"
语义:仅递归展开对象,而数组、标量、`null` 以及空对象都会作为不透明的叶子值原样保留。
+
+如果顶层输入不是对象(例如标量、数组或 `null`),则原样返回。
+
+## 语法
+
+```sql
+JSON_OBJECT_FLATTEN(<json_value>)
+```
+
+## 参数
+
+**`<json_value>`** - 需要展平的 JSON 值,必须是 JSON 类型。
+
+## 返回值
+
+返回一个 JSON 值:
+
+- 如果输入是嵌套的 JSON 对象,返回一个单层 JSON 对象,其键为指向每个叶子值的点连接路径。
+- 如果输入不是对象(标量、数组或 null),返回值与输入相同。
+- 如果输入为 `NULL`,返回 `NULL`。
+
+## 示例
+
+### 基本嵌套对象展平
+
+```sql
+SELECT json_object_flatten('{"a":{"b":2}}');
+```
+
+```text
++--------------------------------------+
+| json_object_flatten('{"a":{"b":2}}') |
++--------------------------------------+
+| {"a.b":2} |
++--------------------------------------+
+```
+
+### 多层嵌套对象
+
+```sql
+SELECT json_object_flatten('{"a":{"b":{"c":3}}}');
+```
+
+```text
++--------------------------------------------+
+| json_object_flatten('{"a":{"b":{"c":3}}}') |
++--------------------------------------------+
+| {"a.b.c":3} |
++--------------------------------------------+
+```
+
+### 已经是单层的对象
+
+```sql
+SELECT json_object_flatten('{"a":1,"b":"hi"}');
+```
+
+```text
++-----------------------------------------+
+| json_object_flatten('{"a":1,"b":"hi"}') |
++-----------------------------------------+
+| {"a":1,"b":"hi"} |
++-----------------------------------------+
+```
+
+### 数组作为不透明叶子值原样保留
+
+```sql
+SELECT json_object_flatten('{"a":[{"b":1},{"b":2}]}');
+```
+
+```text
++------------------------------------------------+
+| json_object_flatten('{"a":[{"b":1},{"b":2}]}') |
++------------------------------------------------+
+| {"a":[{"b":1},{"b":2}]} |
++------------------------------------------------+
+```
+
+```sql
+SELECT json_object_flatten('{"a":{"b":[1,2,3]}}');
+```
+
+```text
++--------------------------------------------+
+| json_object_flatten('{"a":{"b":[1,2,3]}}') |
++--------------------------------------------+
+| {"a.b":[1,2,3]} |
++--------------------------------------------+
+```
+
+### 顶层为非对象时原样返回
+
+```sql
+SELECT json_object_flatten('42');
+```
+
+```text
++---------------------------+
+| json_object_flatten('42') |
++---------------------------+
+| 42 |
++---------------------------+
+```
+
+```sql
+SELECT json_object_flatten('[1,2,{"x":3}]');
+```
+
+```text
++--------------------------------------+
+| json_object_flatten('[1,2,{"x":3}]') |
++--------------------------------------+
+| [1,2,{"x":3}] |
++--------------------------------------+
+```
+
+### 输入为 NULL
+
+```sql
+SELECT json_object_flatten(NULL);
+```
+
+```text
++---------------------------+
+| json_object_flatten(NULL) |
++---------------------------+
+| NULL |
++---------------------------+
+```
+
+### 同时包含标量、数组和子对象的嵌套对象
+
+```sql
+SELECT json_object_flatten('{"x":{"s":1,"a":[1,2],"o":{"k":"v"}}}');
+```
+
+```text
++--------------------------------------------------------------+
+| json_object_flatten('{"x":{"s":1,"a":[1,2],"o":{"k":"v"}}}') |
++--------------------------------------------------------------+
+| {"x.s":1,"x.a":[1,2],"x.o.k":"v"} |
++--------------------------------------------------------------+
+```
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
new file mode 100644
index 00000000000..59a1467941d
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
@@ -0,0 +1,155 @@
+---
+{
+ "title": "JSON_OBJECT_FLATTEN",
+ "language": "zh-CN",
+ "description": "JSON_OBJECT_FLATTEN 将嵌套的 JSON 对象展平为单层 JSON
对象,其键为指向每个叶子值的点连接路径。"
+}
+---
+
+## 描述
+
+`JSON_OBJECT_FLATTEN` 函数将嵌套的 JSON 对象展平为一个单层 JSON
对象,其键是指向每个叶子值的点(`.`)连接路径。该函数遵循 NiFi FlattenJson 的 "keep-arrays"
语义:仅递归展开对象,而数组、标量、`null` 以及空对象都会作为不透明的叶子值原样保留。
+
+如果顶层输入不是对象(例如标量、数组或 `null`),则原样返回。
+
+## 语法
+
+```sql
+JSON_OBJECT_FLATTEN(<json_value>)
+```
+
+## 参数
+
+**`<json_value>`** - 需要展平的 JSON 值,必须是 JSON 类型。
+
+## 返回值
+
+返回一个 JSON 值:
+
+- 如果输入是嵌套的 JSON 对象,返回一个单层 JSON 对象,其键为指向每个叶子值的点连接路径。
+- 如果输入不是对象(标量、数组或 null),返回值与输入相同。
+- 如果输入为 `NULL`,返回 `NULL`。
+
+## 示例
+
+### 基本嵌套对象展平
+
+```sql
+SELECT json_object_flatten('{"a":{"b":2}}');
+```
+
+```text
++--------------------------------------+
+| json_object_flatten('{"a":{"b":2}}') |
++--------------------------------------+
+| {"a.b":2} |
++--------------------------------------+
+```
+
+### 多层嵌套对象
+
+```sql
+SELECT json_object_flatten('{"a":{"b":{"c":3}}}');
+```
+
+```text
++--------------------------------------------+
+| json_object_flatten('{"a":{"b":{"c":3}}}') |
++--------------------------------------------+
+| {"a.b.c":3} |
++--------------------------------------------+
+```
+
+### 已经是单层的对象
+
+```sql
+SELECT json_object_flatten('{"a":1,"b":"hi"}');
+```
+
+```text
++-----------------------------------------+
+| json_object_flatten('{"a":1,"b":"hi"}') |
++-----------------------------------------+
+| {"a":1,"b":"hi"} |
++-----------------------------------------+
+```
+
+### 数组作为不透明叶子值原样保留
+
+```sql
+SELECT json_object_flatten('{"a":[{"b":1},{"b":2}]}');
+```
+
+```text
++------------------------------------------------+
+| json_object_flatten('{"a":[{"b":1},{"b":2}]}') |
++------------------------------------------------+
+| {"a":[{"b":1},{"b":2}]} |
++------------------------------------------------+
+```
+
+```sql
+SELECT json_object_flatten('{"a":{"b":[1,2,3]}}');
+```
+
+```text
++--------------------------------------------+
+| json_object_flatten('{"a":{"b":[1,2,3]}}') |
++--------------------------------------------+
+| {"a.b":[1,2,3]} |
++--------------------------------------------+
+```
+
+### 顶层为非对象时原样返回
+
+```sql
+SELECT json_object_flatten('42');
+```
+
+```text
++---------------------------+
+| json_object_flatten('42') |
++---------------------------+
+| 42 |
++---------------------------+
+```
+
+```sql
+SELECT json_object_flatten('[1,2,{"x":3}]');
+```
+
+```text
++--------------------------------------+
+| json_object_flatten('[1,2,{"x":3}]') |
++--------------------------------------+
+| [1,2,{"x":3}] |
++--------------------------------------+
+```
+
+### 输入为 NULL
+
+```sql
+SELECT json_object_flatten(NULL);
+```
+
+```text
++---------------------------+
+| json_object_flatten(NULL) |
++---------------------------+
+| NULL |
++---------------------------+
+```
+
+### 同时包含标量、数组和子对象的嵌套对象
+
+```sql
+SELECT json_object_flatten('{"x":{"s":1,"a":[1,2],"o":{"k":"v"}}}');
+```
+
+```text
++--------------------------------------------------------------+
+| json_object_flatten('{"x":{"s":1,"a":[1,2],"o":{"k":"v"}}}') |
++--------------------------------------------------------------+
+| {"x.s":1,"x.a":[1,2],"x.o.k":"v"} |
++--------------------------------------------------------------+
+```
diff --git a/sidebars.ts b/sidebars.ts
index 8edfc219570..1e3da0c3192 100644
--- a/sidebars.ts
+++ b/sidebars.ts
@@ -1807,6 +1807,7 @@ const sidebars: SidebarsConfig = {
'sql-manual/sql-functions/scalar-functions/json-functions/json-keys',
'sql-manual/sql-functions/scalar-functions/json-functions/json-length',
'sql-manual/sql-functions/scalar-functions/json-functions/json-object',
+
'sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten',
'sql-manual/sql-functions/scalar-functions/json-functions/json-parse',
'sql-manual/sql-functions/scalar-functions/json-functions/json-parse-error-to-null',
'sql-manual/sql-functions/scalar-functions/json-functions/json-parse-error-to-value',
diff --git
a/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
new file mode 100644
index 00000000000..607926ebb9a
--- /dev/null
+++
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten.md
@@ -0,0 +1,155 @@
+---
+{
+ "title": "JSON_OBJECT_FLATTEN",
+ "language": "en",
+ "description": "JSON_OBJECT_FLATTEN flattens a nested JSON object into a
single-level object whose keys are dot-joined paths to each leaf value."
+}
+---
+
+## Description
+
+`JSON_OBJECT_FLATTEN` flattens a nested JSON object into a single-level JSON
object whose keys are the dot-joined paths to each leaf value. It follows the
NiFi FlattenJson "keep-arrays" semantics: only objects are recursively walked,
while arrays, scalars, nulls, and empty objects are kept as opaque leaf values.
+
+If the top-level input is not an object (for example, a scalar, an array, or
`null`), it is returned unchanged.
+
+## Syntax
+
+```sql
+JSON_OBJECT_FLATTEN(<json_value>)
+```
+
+## Parameters
+
+**`<json_value>`** - The JSON value to flatten. Must be of JSON type.
+
+## Return Value
+
+Returns a JSON value:
+
+- If the input is a nested JSON object, returns a single-level JSON object
whose keys are the dot-joined paths to each leaf value.
+- If the input is not an object (scalar, array, or null), returns the input
unchanged.
+- If the input is `NULL`, returns `NULL`.
+
+## Examples
+
+### Basic nested object flattening
+
+```sql
+SELECT json_object_flatten('{"a":{"b":2}}');
+```
+
+```text
++--------------------------------------+
+| json_object_flatten('{"a":{"b":2}}') |
++--------------------------------------+
+| {"a.b":2} |
++--------------------------------------+
+```
+
+### Deeply nested object
+
+```sql
+SELECT json_object_flatten('{"a":{"b":{"c":3}}}');
+```
+
+```text
++--------------------------------------------+
+| json_object_flatten('{"a":{"b":{"c":3}}}') |
++--------------------------------------------+
+| {"a.b.c":3} |
++--------------------------------------------+
+```
+
+### Already-flat object
+
+```sql
+SELECT json_object_flatten('{"a":1,"b":"hi"}');
+```
+
+```text
++-----------------------------------------+
+| json_object_flatten('{"a":1,"b":"hi"}') |
++-----------------------------------------+
+| {"a":1,"b":"hi"} |
++-----------------------------------------+
+```
+
+### Arrays preserved as opaque leaves
+
+```sql
+SELECT json_object_flatten('{"a":[{"b":1},{"b":2}]}');
+```
+
+```text
++------------------------------------------------+
+| json_object_flatten('{"a":[{"b":1},{"b":2}]}') |
++------------------------------------------------+
+| {"a":[{"b":1},{"b":2}]} |
++------------------------------------------------+
+```
+
+```sql
+SELECT json_object_flatten('{"a":{"b":[1,2,3]}}');
+```
+
+```text
++--------------------------------------------+
+| json_object_flatten('{"a":{"b":[1,2,3]}}') |
++--------------------------------------------+
+| {"a.b":[1,2,3]} |
++--------------------------------------------+
+```
+
+### Top-level non-object values pass through unchanged
+
+```sql
+SELECT json_object_flatten('42');
+```
+
+```text
++---------------------------+
+| json_object_flatten('42') |
++---------------------------+
+| 42 |
++---------------------------+
+```
+
+```sql
+SELECT json_object_flatten('[1,2,{"x":3}]');
+```
+
+```text
++--------------------------------------+
+| json_object_flatten('[1,2,{"x":3}]') |
++--------------------------------------+
+| [1,2,{"x":3}] |
++--------------------------------------+
+```
+
+### NULL input
+
+```sql
+SELECT json_object_flatten(NULL);
+```
+
+```text
++---------------------------+
+| json_object_flatten(NULL) |
++---------------------------+
+| NULL |
++---------------------------+
+```
+
+### Mixed nested object with scalars, arrays, and sub-objects
+
+```sql
+SELECT json_object_flatten('{"x":{"s":1,"a":[1,2],"o":{"k":"v"}}}');
+```
+
+```text
++--------------------------------------------------------------+
+| json_object_flatten('{"x":{"s":1,"a":[1,2],"o":{"k":"v"}}}') |
++--------------------------------------------------------------+
+| {"x.s":1,"x.a":[1,2],"x.o.k":"v"} |
++--------------------------------------------------------------+
+```
diff --git a/versioned_sidebars/version-4.x-sidebars.json
b/versioned_sidebars/version-4.x-sidebars.json
index 57c240ad928..e3594eff415 100644
--- a/versioned_sidebars/version-4.x-sidebars.json
+++ b/versioned_sidebars/version-4.x-sidebars.json
@@ -1978,6 +1978,7 @@
"sql-manual/sql-functions/scalar-functions/json-functions/json-keys",
"sql-manual/sql-functions/scalar-functions/json-functions/json-length",
"sql-manual/sql-functions/scalar-functions/json-functions/json-object",
+
"sql-manual/sql-functions/scalar-functions/json-functions/json-object-flatten",
"sql-manual/sql-functions/scalar-functions/json-functions/json-parse",
"sql-manual/sql-functions/scalar-functions/json-functions/json-parse-error-to-null",
"sql-manual/sql-functions/scalar-functions/json-functions/json-parse-error-to-value",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]