-
Notifications
You must be signed in to change notification settings - Fork 92
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
modify maxHop #1661
Merged
Merged
modify maxHop #1661
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -453,18 +453,31 @@ nebula> MATCH (v:player{name:"Tim Duncan"}) -[*0]-> (v2) \ | |
|
||
### 匹配变长路径 | ||
|
||
用户可以在模式中使用`:<edge_type>*[minHop]..[maxHop]`匹配变长路径。 | ||
用户可以在模式中使用`:<edge_type>*[minHop..maxHop]`匹配变长路径。 | ||
|
||
!!! note | ||
|
||
设置边界时,`minHop` 和 `maxHop` 至少存在其中一个。 | ||
|
||
!!! caution | ||
|
||
如果未设置 `maxHop` 可能会导致 graph 服务 OOM,请谨慎执行该命令。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
|参数|说明| | ||
|:---|:---| | ||
|`minHop`|可选项。表示路径的最小长度。`minHop`必须是一个非负整数,默认值为 1。| | ||
|`maxHop`|可选项。表示路径的最大长度。`maxHop`必须是一个非负整数,没有默认值。| | ||
|
||
!!! compatibility "openCypher 兼容性" | ||
|
||
在 openCypher 中,没有设置`maxHop`时,`..`可以省略。在 nGQL 中,`..`不可以省略。 | ||
|`maxHop`|可选项。表示路径的最大长度。`maxHop`必须是一个非负整数,默认值为无穷大。| | ||
|
||
```ngql | ||
nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*]->(v2) \ | ||
RETURN v2 AS Friends; | ||
+-----------------------------------------------------------+ | ||
| Friends | | ||
+-----------------------------------------------------------+ | ||
| ("player125" :player{age: 41, name: "Manu Ginobili"}) | | ||
| ("player101" :player{age: 36, name: "Tony Parker"}) | | ||
... | ||
|
||
nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*1..3]->(v2) \ | ||
RETURN v2 AS Friends; | ||
+-----------------------------------------------------------+ | ||
|
@@ -474,6 +487,17 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*1..3]->(v2) \ | |
| ("player125" :player{age: 41, name: "Manu Ginobili"}) | | ||
| ("player100" :player{age: 42, name: "Tim Duncan"}) | | ||
... | ||
|
||
nebula> MATCH p=(v:player{name:"Tim Duncan"})-[e:follow*1..]->(v2) \ | ||
RETURN v2 AS Friends; | ||
Comment on lines
+491
to
+492
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 如果用户没注意前面的caution,直接拿这个例子去改,可能会oom。所以我们是不是考虑不要放这个例子? |
||
+-----------------------------------------------------------+ | ||
| Friends | | ||
+-----------------------------------------------------------+ | ||
| ("player125" :player{age: 41, name: "Manu Ginobili"}) | | ||
| ("player101" :player{age: 36, name: "Tony Parker"}) | | ||
| ("player100" :player{age: 42, name: "Tim Duncan"}) | | ||
... | ||
|
||
``` | ||
|
||
用户可以使用`DISTINCT`关键字聚合重复结果。 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not good...