Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Feb 6, 2023
1 parent 18e213f commit b3768cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graph/validator/MatchValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,13 +1294,13 @@ Status MatchValidator::validatePathInWhere(
/*static*/ Status MatchValidator::buildRollUpPathInfo(const MatchPath *path, Path &pathInfo) {
for (const auto &node : path->nodes()) {
// The inner variable of expression will be replaced by anno variable
if (!node->alias().empty() && node->alias()[0] != '_') {
if (!node->anonymous()) {
pathInfo.compareVariables.emplace_back(node->alias());
}
}
for (const auto &edge : path->edges()) {
const auto &edgeAlias = edge->alias();
if (!edgeAlias.empty() && edgeAlias.front() != '_') {
if (!edge->anonymous()) {
if (edge->range()) {
return Status::SemanticError(
"Variable '%s` 's type is list. not support used in multiple patterns "
Expand Down
8 changes: 8 additions & 0 deletions src/parser/MatchPath.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ class MatchEdge final {
return range_.get();
}

bool anonymous() const {
return alias_.empty() || alias_.front() == '_';
}

std::string toString() const;

MatchEdge clone() const {
Expand Down Expand Up @@ -233,6 +237,10 @@ class MatchNode final {
return alias_;
}

bool anonymous() const {
return alias_.empty() || alias_.front() == '_';
}

const auto* labels() const {
return labels_.get();
}
Expand Down

0 comments on commit b3768cd

Please sign in to comment.