Skip to content

Commit

Permalink
fix dangling edge
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Oct 8, 2021
1 parent e642c05 commit 63bbd56
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/graph/executor/query/DataCollectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ Status DataCollectExecutor::collectMultiplePairShortestPath(const std::vector<st
Status DataCollectExecutor::collectPathProp(const std::vector<std::string>& vars) {
DataSet ds;
ds.colNames = colNames_;
DCHECK(!ds.colNames.empty());
// 0: vertices's props, 1: Edges's props 2: paths without prop
DCHECK_EQ(vars.size(), 3);

Expand All @@ -284,7 +283,7 @@ Status DataCollectExecutor::collectPathProp(const std::vector<std::string>& vars
DCHECK(vIter->isPropIter());
for (; vIter->valid(); vIter->next()) {
const auto& vertexVal = vIter->getVertex();
if (!vertexVal.isVertex()) {
if (UNLIKELY(!vertexVal.isVertex())) {
continue;
}
const auto& vertex = vertexVal.getVertex();
Expand All @@ -296,8 +295,8 @@ Status DataCollectExecutor::collectPathProp(const std::vector<std::string>& vars
edgeMap.reserve(eIter->size());
DCHECK(eIter->isPropIter());
for (; eIter->valid(); eIter->next()) {
auto edgeVal = eIter->getEdge();
if (!edgeVal.isEdge()) {
const auto& edgeVal = eIter->getEdge();
if (UNLIKELY(!edgeVal.isEdge())) {
continue;
}
auto& edge = edgeVal.getEdge();
Expand All @@ -308,8 +307,8 @@ Status DataCollectExecutor::collectPathProp(const std::vector<std::string>& vars
auto pIter = ectx_->getResult(vars[2]).iter();
DCHECK(pIter->isSequentialIter());
for (; pIter->valid(); pIter->next()) {
auto& pathVal = pIter->getColumn(0);
if (!pathVal.isPath()) {
const auto& pathVal = pIter->getColumn(0);
if (UNLIKELY(!pathVal.isPath())) {
continue;
}
auto path = pathVal.getPath();
Expand All @@ -320,13 +319,15 @@ Status DataCollectExecutor::collectPathProp(const std::vector<std::string>& vars
}
for (auto& step : path.steps) {
auto dst = step.dst.vid;
step.dst = vertexMap[dst];
found = vertexMap.find(dst);
if (found != vertexMap.end()) {
step.dst = found->second;
}

auto type = step.type;
auto ranking = step.ranking;
if (type < 0) {
dst = src;
src = step.dst.vid;
std::swap(src, dst);
type = -type;
}
auto edgeKey = std::make_tuple(src, type, ranking, dst);
Expand Down

0 comments on commit 63bbd56

Please sign in to comment.