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 some filter don't push down project. #4841

Merged
merged 2 commits into from
Nov 10, 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
20 changes: 13 additions & 7 deletions src/graph/util/ExpressionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ namespace graph {

bool ExpressionUtils::isPropertyExpr(const Expression *expr) {
return isKindOf(expr,
{Expression::Kind::kTagProperty,
Expression::Kind::kLabelTagProperty,
Expression::Kind::kEdgeProperty,
Expression::Kind::kInputProperty,
Expression::Kind::kVarProperty,
Expression::Kind::kDstProperty,
Expression::Kind::kSrcProperty});
{
Expression::Kind::kTagProperty,
Expression::Kind::kLabelTagProperty,
Expression::Kind::kEdgeProperty,
Expression::Kind::kEdgeSrc,
Expression::Kind::kEdgeType,
Expression::Kind::kEdgeRank,
Expression::Kind::kEdgeDst,
Expression::Kind::kInputProperty,
Expression::Kind::kVarProperty,
Expression::Kind::kDstProperty,
Expression::Kind::kSrcProperty,
});
}

const Expression *ExpressionUtils::findAny(const Expression *self,
Expand Down
30 changes: 30 additions & 0 deletions tests/tck/features/bugfix/PredicationPushDownInGo.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2022 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License.
Feature: Test predication push down in go

Background:
Given a graph with space named "nba"

# #4838
Scenario: predication push down in go
When profiling query:
"""
GO FROM "Tim Duncan" OVER like WHERE like._dst NOT IN ["xxx"]
YIELD like._dst as dst |
GO FROM $-.dst OVER like REVERSELY WHERE like._dst IN ["Tim Duncan"]
YIELD like._dst AS dst;
"""
Then the result should be, in any order:
| dst |
| "Tim Duncan" |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 10 | Project | 15 | |
| 15 | InnerJoin | 17 | |
| 17 | Project | 18 | |
| 18 | GetNeighbors | 3 | { "filter": "(like._dst IN [\"Tim Duncan\"])" } |
| 3 | Project | 11 | |
| 11 | GetNeighbors | 0 | |
| 0 | Start | | |