Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Aug 17, 2022
1 parent 5f48793 commit 0738158
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/graph/visitor/PropertyTrackerVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,14 @@ void PropertyTrackerVisitor::visit(AggregateExpression *expr) {
auto funName = expr->name();
std::transform(funName.begin(), funName.end(), funName.begin(), ::tolower);
if (funName == "count") {
return;
auto *argExpr = expr->arg();
if (argExpr->kind() == Expression::Kind::kConstant ||
argExpr->kind() == Expression::Kind::kInputProperty ||
argExpr->kind() == Expression::Kind::kVarProperty) {
return;
}
}
// count(v.player.age)
expr->arg()->accept(this);
}

Expand Down
18 changes: 18 additions & 0 deletions tests/tck/features/optimizer/PrunePropertiesRule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,24 @@ Feature: Prune Properties rule

@distonly
Scenario: return function
When profiling query:
"""
MATCH (v1)-[e:like*1..5]->(v2)
WHERE id(v1) == "Tim Duncan"
RETURN count(v2.player.age)
"""
Then the result should be, in order:
| count(v2.player.age) |
| 24 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 7 | Aggregate | 6 | |
| 6 | Project | 5 | |
| 5 | AppendVertices | 4 | { "props": "[{\"props\":[\"age\"],\"tagId\":9}]" } |
| 4 | Traverse | 2 | {"vertexProps": "", "edgeProps": "[{\"type\": 3, \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } |
| 2 | Dedup | 1 | |
| 1 | PassThrough | 3 | |
| 3 | Start | | |
When profiling query:
"""
MATCH (v1)-[e:like*1..5]->(v2)
Expand Down

0 comments on commit 0738158

Please sign in to comment.