Skip to content

Commit

Permalink
change comment and function name
Browse files Browse the repository at this point in the history
  • Loading branch information
aziz-mu committed May 19, 2023
1 parent 8f8913c commit ac7ed7a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/binder/bind/bind_graph_pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ Binder::bindGraphPattern(const std::vector<std::unique_ptr<PatternElement>>& gra
return std::make_pair(std::move(queryGraphCollection), std::move(propertyCollection));
}

void static addUndirectedTableNames(const PatternElement& patternElement) {
// Neighbouring nodes connected by an undirected query need to each contain a union
// of table names so that the query works.
void static rewriteNodeTableNameForUndirectedRel(const PatternElement& patternElement) {
// For undirected pattern (A)-[R]-(B), we need to match R in both FWD and BWD direction.
// Since computation always starts from one node, we need to rewrite the node table names to be
// the union of both node table names, i.e. (A|B)-[R]-(A|B)
auto leftNode = patternElement.getFirstNodePattern();
for (auto i = 0u; i < patternElement.getNumPatternElementChains(); ++i) {
auto patternElementChain = patternElement.getPatternElementChain(i);
Expand All @@ -54,7 +55,7 @@ void static addUndirectedTableNames(const PatternElement& patternElement) {
// Grammar ensures pattern element is always connected and thus can be bound as a query graph.
std::unique_ptr<QueryGraph> Binder::bindPatternElement(
const PatternElement& patternElement, PropertyKeyValCollection& collection) {
addUndirectedTableNames(patternElement);
rewriteNodeTableNameForUndirectedRel(patternElement);
auto queryGraph = std::make_unique<QueryGraph>();
auto leftNode = bindQueryNode(*patternElement.getFirstNodePattern(), *queryGraph, collection);
for (auto i = 0u; i < patternElement.getNumPatternElementChains(); ++i) {
Expand Down

0 comments on commit ac7ed7a

Please sign in to comment.