Skip to content

Commit

Permalink
Modify write file interface (#712)
Browse files Browse the repository at this point in the history
* add core dump

* add core dump

* fix cpplint

* vit check

* merge master
  • Loading branch information
lipanpan03 authored Oct 24, 2024
1 parent 665804d commit f419634
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions include/lgraph/olap_on_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -1525,18 +1525,21 @@ class OlapOnDB : public OlapBase<EdgeData> {
if (output_filter != nullptr && !output_filter(i, vertex_data[i])) {
continue;
}
auto vit = txn_.GetVertexIterator(OriginalVid(i));
auto vit_label = vit.GetLabel();
auto primary_field = txn_.GetVertexPrimaryField(vit_label);
auto field_data = vit.GetField(primary_field);
json curJson;
curJson["vid"] = OriginalVid(i);
curJson["label"] = vit_label;
curJson["primary_field"] = primary_field;
curJson["field_data"] = field_data.ToString();
curJson["result"] = vertex_data[i];
auto content = curJson.dump() + "\n";
fout.Write(content.c_str(), content.size());
auto vit = txn_.GetVertexIterator();
vit.Goto(OriginalVid(i));
if (vit.IsValid()) {
auto vit_label = vit.GetLabel();
auto primary_field = txn_.GetVertexPrimaryField(vit_label);
auto field_data = vit.GetField(primary_field);
json curJson;
curJson["vid"] = OriginalVid(i);
curJson["label"] = vit_label;
curJson["primary_field"] = primary_field;
curJson["field_data"] = field_data.ToString();
curJson["result"] = vertex_data[i];
auto content = curJson.dump() + "\n";
fout.Write(content.c_str(), content.size());
}
}
}

Expand Down

0 comments on commit f419634

Please sign in to comment.