Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Fix sjs subgraph. #1246

Merged
merged 1 commit into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions src/context/Iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ void GetNeighborsIter::next() {
}

void GetNeighborsIter::erase() {
hadErase_ = true;
DCHECK_GE(bitIdx_, 0);
DCHECK_LT(bitIdx_, bitset_.size());
bitset_[bitIdx_] = false;
Expand Down Expand Up @@ -366,15 +367,28 @@ Value GetNeighborsIter::getVertex() const {

List GetNeighborsIter::getVertices() {
List vertices;
vertices.values.reserve(size());
auto currRowTmp = currentRow_;
vertices.values.emplace_back(getVertex());
for (; valid(); next()) {
if (currRowTmp == currentRow_) {
continue;
}
// vertices.values.reserve(size());
if (hadErase_) {
auto currRowTmp = currentRow_;
vertices.values.emplace_back(getVertex());
currRowTmp = currentRow_;
for (; valid(); next()) {
if (currRowTmp == currentRow_) {
continue;
}
vertices.values.emplace_back(getVertex());
currRowTmp = currentRow_;
}
} else {
valid_ = true;
colIdx_ = -2;
for (currentDs_ = dsIndices_.begin(); currentDs_ < dsIndices_.end(); ++currentDs_) {
rowsUpperBound_ = currentDs_->ds->rows.end();
for (currentRow_ = currentDs_->ds->rows.begin();
currentRow_ < currentDs_->ds->rows.end(); ++currentRow_) {
vertices.values.emplace_back(getVertex());
VLOG(1) << "vertex: " << getVertex() << " size: " << vertices.size();
}
}
}
reset();
return vertices;
Expand Down
1 change: 1 addition & 0 deletions src/context/Iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ class GetNeighborsIter final : public Iterator {

boost::dynamic_bitset<> bitset_;
int64_t bitIdx_{-1};
bool hadErase_{false};
};

class SequentialIter : public Iterator {
Expand Down
2 changes: 1 addition & 1 deletion src/executor/algo/SubgraphExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ folly::Future<Status> SubgraphExecutor::execute() {
}
}

VLOG(1) << "Next step vid is : " << ds;
VLOG(2) << "Next step vid is : " << ds;
return finish(ResultBuilder().value(Value(std::move(ds))).iter(Iterator::Kind::kProp).finish());
}

Expand Down