This is an automated email from the ASF dual-hosted git repository.
zclll 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 176752cdb01 [docs](function) support 'map_contains_entry' and
'map_entries' functions (#2779)
176752cdb01 is described below
commit 176752cdb01e51918665af2f2221d26ff4e092b0
Author: DayuanX <[email protected]>
AuthorDate: Tue Sep 16 12:03:34 2025 +0800
[docs](function) support 'map_contains_entry' and 'map_entries' functions
(#2779)
## Versions
- [X] dev
- [ ] 3.0
- [ ] 2.1
- [ ] 2.0
## Languages
- [X] Chinese
- [X] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
Co-authored-by: zclllyybb <[email protected]>
---
.../map-functions/map-contains-entry.md | 68 +++++++++++++++++++++
.../scalar-functions/map-functions/map-entries.md | 47 +++++++++++++++
.../map-functions/map-contains-entry.md | 70 ++++++++++++++++++++++
.../scalar-functions/map-functions/map-entries.md | 46 ++++++++++++++
sidebars.json | 2 +
5 files changed, 233 insertions(+)
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/map-functions/map-contains-entry.md
b/docs/sql-manual/sql-functions/scalar-functions/map-functions/map-contains-entry.md
new file mode 100644
index 00000000000..6847e111c06
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/map-functions/map-contains-entry.md
@@ -0,0 +1,68 @@
+---
+{
+ "title": "MAP_CONTAINS_ENTRY",
+ "language": "en"
+}
+---
+
+## Description
+
+Determines whether the given `map` contains a specific entry `(key, value)`
+
+## Syntax
+
+```sql
+MAP_CONTAINS_ENTRY(<map>, <key>, <value>)
+```
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<map>` | Input map content |
+| `<key>` | The key to be retrieved |
+| `<value>` | The value to be retrieved |
+
+## Return Value
+
+Determines whether the given `map` contains a specific `(key, value)` pair.
Returns 1 if it exists, otherwise returns 0. If `<map>` is `NULL`, returns
`NULL`.
+
+Key and value comparisons use "null-safe equal" (two `NULL`s are considered
equal), which differs from the standard SQL definition.
+
+## Example
+
+```sql
+select map_contains_entry(map(null, 1, 2, null), null, 1);
+```
+
+```text
++----------------------------------------------------+
+| map_contains_entry(map(null, 1, 2, null), null, 1) |
++----------------------------------------------------+
+| 1 |
++----------------------------------------------------+
+```
+
+```sql
+select map_contains_entry(map(1, '100', 0.1, '2'), 1, '100');
+```
+
+```text
++-------------------------------------------------------+
+| map_contains_entry(map(1, '100', 0.1, '2'), 1, '100') |
++-------------------------------------------------------+
+| 1 |
++-------------------------------------------------------+
+```
+
+```sql
+select map_contains_entry(map(1, '100', 0.1, '2'), 0.11, '2');
+```
+
+```text
++--------------------------------------------------------+
+| map_contains_entry(map(1, '100', 0.1, '2'), 0.11, '2') |
++--------------------------------------------------------+
+| 0 |
++--------------------------------------------------------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/map-functions/map-entries.md
b/docs/sql-manual/sql-functions/scalar-functions/map-functions/map-entries.md
new file mode 100644
index 00000000000..56dbd70d7b7
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/map-functions/map-entries.md
@@ -0,0 +1,47 @@
+---
+{
+ "title": "MAP_ENTRIES",
+ "language": "en"
+}
+---
+
+## Description
+
+Converts the given `map` into an `ARRAY<STRUCT<key, value>>`.
+
+Each element of the returned array is a struct with two named fields: `key`
and `value`. Both fields are nullable.
+The `key` and `value` field types are the same as the map's key and value
types respectively.
+
+## Syntax
+
+```sql
+MAP_ENTRIES(<map>)
+```
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<map>` | Input map content |
+
+## Return Value
+
+Returns an array of structs that represent the entries of the map. If `<map>`
is `NULL`, returns `NULL`.
+
+## Example
+
+```sql
+select
+ map_entries(map()),
+ map_entries(map(1, '100', 0.1, '2'));
+```
+
+```text
++--------------------+--------------------------------------------------------+
+| map_entries(map()) | map_entries(map(1, '100', 0.1, '2')) |
++--------------------+--------------------------------------------------------+
+| [] | [{"key":1.0, "value":"100"}, {"key":0.1, "value":"2"}] |
++--------------------+--------------------------------------------------------+
+```
+
+
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/map-functions/map-contains-entry.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/map-functions/map-contains-entry.md
new file mode 100644
index 00000000000..36d06f23500
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/map-functions/map-contains-entry.md
@@ -0,0 +1,70 @@
+---
+{
+ "title": "MAP_CONTAINS_ENTRY",
+ "language": "zh-CN"
+}
+---
+
+## 描述
+
+判断给定 `map` 中是否包含指定的 `(key, value)` 键值对。
+
+## 语法
+
+```sql
+MAP_CONTAINS_ENTRY(<map>, <key>, <value>)
+```
+
+## 参数
+
+| 参数 | 说明 |
+| -- | -- |
+| `<map>` | 输入的 map 内容 |
+| `<key>` | 需要检索的键 |
+| `<value>` | 需要检索的值 |
+
+## 返回值
+
+判断给定 `map` 中是否包含指定的 `(key, value)` 键值对。存在返回 1,不存在返回 0。若 `<map>` 为 `NULL`,返回
`NULL`。
+
+键和值的比较使用 “null-safe equal”(两个 `NULL` 视为相等),这与标准 SQL 定义不同。
+
+## 举例
+
+```sql
+select map_contains_entry(map(null, 1, 2, null), null, 1);
+```
+
+```text
++----------------------------------------------------+
+| map_contains_entry(map(null, 1, 2, null), null, 1) |
++----------------------------------------------------+
+| 1 |
++----------------------------------------------------+
+```
+
+```sql
+select map_contains_entry(map(1, '100', 0.1, '2'), 1, '100');
+```
+
+```text
++-------------------------------------------------------+
+| map_contains_entry(map(1, '100', 0.1, '2'), 1, '100') |
++-------------------------------------------------------+
+| 1 |
++-------------------------------------------------------+
+```
+
+```sql
+select map_contains_entry(map(1, '100', 0.1, '2'), 0.11, '2');
+```
+
+```text
++--------------------------------------------------------+
+| map_contains_entry(map(1, '100', 0.1, '2'), 0.11, '2') |
++--------------------------------------------------------+
+| 0 |
++--------------------------------------------------------+
+```
+
+
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/map-functions/map-entries.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/map-functions/map-entries.md
new file mode 100644
index 00000000000..4eafd9f222e
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/map-functions/map-entries.md
@@ -0,0 +1,46 @@
+---
+{
+ "title": "MAP_ENTRIES",
+ "language": "zh-CN"
+}
+---
+
+## 描述
+
+将给定的 `map` 转换为 `ARRAY<STRUCT<key, value>>`
+
+返回数组中的每个元素都是一个 struct, 其中包含两个命名字段 `key` 与 `value`。两个字段均可为空。`key` 与 `value`
字段的类型分别与 map 的键类型和值类型相同。
+
+## 语法
+
+```sql
+MAP_ENTRIES(<map>)
+```
+
+## 参数
+
+| 参数 | 说明 |
+| -- | -- |
+| `<map>` | 输入的 map 内容 |
+
+## 返回值
+
+返回表示该 map 条目的 struct 数组。若 `<map>` 为 `NULL`,返回 `NULL`。
+
+## 举例
+
+```sql
+select
+ map_entries(map()),
+ map_entries(map(1, '100', 0.1, '2'));
+```
+
+```text
++--------------------+--------------------------------------------------------+
+| map_entries(map()) | map_entries(map(1, '100', 0.1, '2')) |
++--------------------+--------------------------------------------------------+
+| [] | [{"key":1.0, "value":"100"}, {"key":0.1, "value":"2"}] |
++--------------------+--------------------------------------------------------+
+```
+
+
diff --git a/sidebars.json b/sidebars.json
index 4700d67c7e5..2cd0d3491f0 100644
--- a/sidebars.json
+++ b/sidebars.json
@@ -1547,8 +1547,10 @@
"label": "MAP Functions",
"items": [
"sql-manual/sql-functions/scalar-functions/map-functions/map",
+
"sql-manual/sql-functions/scalar-functions/map-functions/map-contains-entry",
"sql-manual/sql-functions/scalar-functions/map-functions/map-contains-key",
"sql-manual/sql-functions/scalar-functions/map-functions/map-contains-value",
+
"sql-manual/sql-functions/scalar-functions/map-functions/map-entries",
"sql-manual/sql-functions/scalar-functions/map-functions/map-keys",
"sql-manual/sql-functions/scalar-functions/map-functions/map-size",
"sql-manual/sql-functions/scalar-functions/map-functions/map-values",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]