Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix subgraph crash #4698

Merged
merged 1 commit into from
Oct 9, 2022
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
9 changes: 6 additions & 3 deletions src/graph/context/Iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ Status GetNeighborsIter::processList(std::shared_ptr<Value> value) {
if (UNLIKELY(!val.isDataSet())) {
return Status::Error("There is a value in list which is not a data set.");
}
auto status = makeDataSetIndex(val.getDataSet());
NG_RETURN_IF_ERROR(status);
dsIndices_.emplace_back(std::move(status).value());
const auto& dataSet = val.getDataSet();
if (dataSet.rowSize() != 0) {
auto status = makeDataSetIndex(dataSet);
NG_RETURN_IF_ERROR(status);
dsIndices_.emplace_back(std::move(status).value());
}
}
return Status::OK();
}
Expand Down
10 changes: 5 additions & 5 deletions src/graph/context/test/IteratorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ TEST(IteratorTest, TestHead) {
auto val = std::make_shared<Value>(std::move(datasets));
GetNeighborsIter iter(nullptr);
auto status = iter.processList(val);
EXPECT_FALSE(status.ok());
EXPECT_TRUE(status.ok());
}
{
// no _stats
Expand All @@ -592,7 +592,7 @@ TEST(IteratorTest, TestHead) {
auto val = std::make_shared<Value>(std::move(datasets));
GetNeighborsIter iter(nullptr);
auto status = iter.processList(val);
EXPECT_FALSE(status.ok());
EXPECT_TRUE(status.ok());
}
{
// no _expr
Expand All @@ -603,7 +603,7 @@ TEST(IteratorTest, TestHead) {
auto val = std::make_shared<Value>(std::move(datasets));
GetNeighborsIter iter(nullptr);
auto status = iter.processList(val);
EXPECT_FALSE(status.ok());
EXPECT_TRUE(status.ok());
}
{
// no +/- before edge name
Expand All @@ -615,7 +615,7 @@ TEST(IteratorTest, TestHead) {
auto val = std::make_shared<Value>(std::move(datasets));
GetNeighborsIter iter(nullptr);
auto status = iter.processList(val);
EXPECT_FALSE(status.ok());
EXPECT_TRUE(status.ok());
}
// no prop
{
Expand Down Expand Up @@ -645,7 +645,7 @@ TEST(IteratorTest, TestHead) {
auto val = std::make_shared<Value>(std::move(datasets));
GetNeighborsIter iter(nullptr);
auto status = iter.processList(val);
EXPECT_FALSE(status.ok());
EXPECT_TRUE(status.ok());
}
}

Expand Down