Skip to content

Commit

Permalink
add tck
Browse files Browse the repository at this point in the history
  • Loading branch information
jievince committed Feb 1, 2023
1 parent af6e1da commit 43ae431
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph/visitor/PropertyTrackerVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void PropertyTrackerVisitor::visit(FunctionCallExpression *expr) {
// length function support `STRING` input too, so we can't ignore it directly
// TODO add type info to variable to help optimize it.
static const std::unordered_set<std::string> ignoreFuncs = {
"src", "dst", "type", "typeid", "id", "rank", /*, "length"*/};
"src", "dst", "type", "typeid", "id", "rank" /*, "length"*/};

auto funName = expr->name();
std::transform(funName.begin(), funName.end(), funName.begin(), ::tolower);
Expand Down
25 changes: 25 additions & 0 deletions tests/tck/features/optimizer/PrunePropertiesRule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,31 @@ Feature: Prune Properties rule
| 6 | Argument | 0 | |
| 0 | Start | | |

Scenario: Project after aggregate
Given a graph with space named "nba"
When profiling query:
"""
MATCH (v1:player)-[e:like]->(v2:player)
WHERE id(v1) == "Tony Parker"
WITH v1, v2, count(e.likeness) AS cnt
RETURN v1.player.age, v2.player.age, cnt
"""
Then the result should be, in order:
| v1.player.age | v2.player.age | cnt |
| 36 | 42 | 1 |
| 36 | 41 | 1 |
| 36 | 33 | 1 |
And the execution plan should be:
| id | name | dependencies | profiling data | operator info |
| 8 | Project | 7 | | |
| 7 | Aggregate | 6 | | |
| 6 | Project | 10 | | |
| 10 | AppendVertices | 9 | | { "props": "[{ \"props\":[\"age\", \"_tag\"]}]" } |
| 9 | Traverse | 2 | | { "vertexProps": "[{ \"props\":[\"age\"]}]", "edgeProps": "[{\"props\": [\"_src\", \"_dst\", \"_rank\", \"_type\", \"likeness\"]}]" } |
| 2 | Dedup | 1 | | |
| 1 | PassThrough | 3 | | |
| 3 | Start | | | |

# The schema id is not fixed in standalone cluster, so we skip it
@distonly
Scenario: Optional Match
Expand Down

0 comments on commit 43ae431

Please sign in to comment.