Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix coalesce() #1860

Merged
merged 1 commit into from
Jun 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs-2.0/3.ngql-guide/6.functions-and-expressions/6.list.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Nebula Graph 支持以下列表(List)函数。
| tail(list) | 返回不包含原列表第一个元素的新列表。|
| head(list) | 返回列表的第一个元素。 |
| last(list) | 返回列表的最后一个元素。 |
| coalesce(list) | 返回列表中第一个非空元素。 |
| coalesce(item0 [, item1, item2]) | 返回多个参数中第一个非空元素。 |
| reduce() | 请参见 [reduce 函数](./11.reduce.md)。 |

!!! Note
Expand All @@ -24,12 +24,12 @@ Nebula Graph 支持以下列表(List)函数。

```ngql
nebula> WITH [NULL, 4923, 'abc', 521, 487] AS ids \
RETURN reverse(ids), tail(ids), head(ids), last(ids), coalesce(ids);
+-----------------------------------+-------------------------+-----------+-----------+---------------+
| reverse(ids) | tail(ids) | head(ids) | last(ids) | coalesce(ids) |
+-----------------------------------+-------------------------+-----------+-----------+---------------+
| [487, 521, "abc", 4923, __NULL__] | [4923, "abc", 521, 487] | __NULL__ | 487 | 4923 |
+-----------------------------------+-------------------------+-----------+-----------+---------------+
RETURN reverse(ids), tail(ids), head(ids), last(ids), coalesce(ids[0], ids[1], ids[2]), head([x IN ids WHERE x IS NOT NULL | x]);
+-----------------------------------+-------------------------+-----------+-----------+--------------------------------+--------------------------------------------------------------+
| reverse(ids) | tail(ids) | head(ids) | last(ids) | coalesce(ids[0],ids[1],ids[2]) | head([__VAR_0 IN ids WHERE $__VAR_0 IS NOT NULL | $__VAR_0]) |
+-----------------------------------+-------------------------+-----------+-----------+--------------------------------+--------------------------------------------------------------+
| [487, 521, "abc", 4923, __NULL__] | [4923, "abc", 521, 487] | __NULL__ | 487 | 4923 | 4923 |
+-----------------------------------+-------------------------+-----------+-----------+--------------------------------+--------------------------------------------------------------+

nebula> MATCH (a:player)-[r]->() \
WHERE id(a) == "player100" \
Expand Down