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 scan efilter. #5171

Merged
merged 2 commits into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ bool GetEdgesTransformAppendVerticesLimitRule::match(OptContext *ctx,
if (traverse->stepRange() != nullptr) {
return false;
}
// Can't apply vertex filter in GetEdges
if (traverse->vFilter() != nullptr) {
return false;
}
// If edge filter is not null, means it's can't be pushed down to storage
if (traverse->eFilter() != nullptr) {
return false;
}
for (auto yieldColumn : project->columns()->columns()) {
// exclude p=()-[e]->() return p limit 10
if (yieldColumn->expr()->kind() == nebula::Expression::Kind::kPathBuild) {
Expand Down
8 changes: 8 additions & 0 deletions src/graph/optimizer/rule/GetEdgesTransformRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ bool GetEdgesTransformRule::match(OptContext *ctx, const MatchedResult &matched)
if (traverse->stepRange() != nullptr) {
return false;
}
// Can't apply vertex filter in GetEdges
if (traverse->vFilter() != nullptr) {
return false;
}
// If edge filter is not null, means it's can't be pushed down to storage
if (traverse->eFilter() != nullptr) {
return false;
}
for (auto yieldColumn : project->columns()->columns()) {
// exclude p=()-[e]->() return p limit 10
if (yieldColumn->expr()->kind() == nebula::Expression::Kind::kPathBuild) {
Expand Down
25 changes: 25 additions & 0 deletions tests/tck/features/bugfix/LackFilterGetEdges.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2022 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License.
Feature: Test lack filter of get edges transform

Background:
Given a graph with space named "nba"

# #5145
Scenario: Lack filter of get edges transform
When profiling query:
"""
match ()-[e]->()
where e.likeness > 78 or uuid() > 100
return rank(e) limit 3
"""
Then a ExecutionError should be raised at runtime: Scan vertices or edges need to specify a limit number, or limit number can not push down.
And the execution plan should be:
| id | name | dependencies | operator info |
| 24 | Project | 20 | |
| 20 | Limit | 21 | |
| 21 | AppendVertices | 23 | |
| 23 | Traverse | 22 | { "edge filter": "((*.likeness>78) OR (uuid()>100))"} |
| 22 | ScanVertices | 3 | |
| 3 | Start | | |