Skip to content

Commit

Permalink
Fix some filter don't push down project. (#4841)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shylock-Hg authored Nov 10, 2022
1 parent d9c4a6c commit 4191724
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
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 | | |

0 comments on commit 4191724

Please sign in to comment.