From f41963418e1309f926e303bc874f81c689813892 Mon Sep 17 00:00:00 2001 From: lipanpan03 <41904587+lipanpan03@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:59:31 +0800 Subject: [PATCH] Modify write file interface (#712) * add core dump * add core dump * fix cpplint * vit check * merge master --- include/lgraph/olap_on_db.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/include/lgraph/olap_on_db.h b/include/lgraph/olap_on_db.h index aecd5b03db..0ab79728ef 100644 --- a/include/lgraph/olap_on_db.h +++ b/include/lgraph/olap_on_db.h @@ -1525,18 +1525,21 @@ class OlapOnDB : public OlapBase { 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()); + } } }