Skip to content

Commit

Permalink
Fix RollUpApplyExecutor (#4778)
Browse files Browse the repository at this point in the history
Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>
  • Loading branch information
Aiee and Sophie-Xie committed Oct 24, 2022
1 parent 7071d0c commit 1eef294
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/graph/executor/query/RollUpApplyExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,21 @@ folly::Future<Status> RollUpApplyExecutor::rollUpApply() {
NG_RETURN_IF_ERROR(checkBiInputDataSets());
DataSet result;
mv_ = movable(node()->inputVars()[0]);

if (rollUpApplyNode->compareCols().size() == 0) {
List hashTable;
buildZeroKeyHashTable(rollUpApplyNode->collectCol(), rhsIter_.get(), hashTable);
result = probeZeroKey(lhsIter_.get(), hashTable);
} else if (rollUpApplyNode->compareCols().size() == 1) {
std::unordered_map<Value, List> hashTable;
buildSingleKeyHashTable(rollUpApplyNode->compareCols()[0],
// Clone the expression so when evaluating the InputPropertyExpression, the propIndex_ will not
// be buffered.
buildSingleKeyHashTable(rollUpApplyNode->compareCols()[0]->clone(),
rollUpApplyNode->collectCol(),
rhsIter_.get(),
hashTable);
result = probeSingleKey(rollUpApplyNode->compareCols()[0], lhsIter_.get(), hashTable);

result = probeSingleKey(rollUpApplyNode->compareCols()[0]->clone(), lhsIter_.get(), hashTable);
} else {
std::unordered_map<List, List> hashTable;
buildHashTable(
Expand Down
10 changes: 10 additions & 0 deletions tests/tck/features/match/PathExpr.feature
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ Feature: Basic match
| name |
| "Tim Duncan" |
| "Tim Duncan" |
When executing query:
"""
MATCH (v:player{name:"Tim Duncan"})<-[:like]-(v2) WHERE NOT (v2)<-[:like]-() RETURN v2;
"""
Then the result should be, in any order:
| v2 |
| ("Dejounte Murray" :player{age: 29, name: "Dejounte Murray"}) |
| ("Aron Baynes" :player{age: 32, name: "Aron Baynes"}) |
| ("Tiago Splitter" :player{age: 34, name: "Tiago Splitter"}) |
| ("Boris Diaw" :player{age: 36, name: "Boris Diaw"}) |

Scenario: In With
When executing query:
Expand Down

0 comments on commit 1eef294

Please sign in to comment.