Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
Committed-by: xiaolei.zl from Dev container
  • Loading branch information
zhanglei1949 committed Dec 13, 2024
1 parent 7d96ea6 commit ef624b2
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 502 deletions.
3 changes: 1 addition & 2 deletions flex/engines/graph_db/app/builtin/k_hop_neighbors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ results::CollectiveResults KNeighbors::Query(const GraphDBSession& sess,
->mutable_entry()
->mutable_element()
->mutable_object()
->mutable_str()
->assign(label_name_.data(), label_name_.size());
->set_str(label_name_);
result->mutable_record()
->add_columns()
->mutable_entry()
Expand Down
3 changes: 1 addition & 2 deletions flex/engines/graph_db/app/builtin/pagerank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ results::CollectiveResults PageRank::Query(const GraphDBSession& sess,
->mutable_entry()
->mutable_element()
->mutable_object()
->mutable_str()
->assign(vertex_label.data(), vertex_label.size());
->set_str(vertex_label);
result->mutable_record()
->add_columns()
->mutable_entry()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ results::CollectiveResults ShortestPathAmongThree::Query(
->mutable_entry()
->mutable_element()
->mutable_object()
->mutable_str()
->assign(result_path);
->set_str(result_path);

txn.Commit();
return results;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ bl::result<procedure::Query> fill_in_query(const procedure::Query& query,
} else if (val.type() == gs::runtime::RTAnyType::kI32Value) {
const_value->set_i32(val.as_int32());
} else if (val.type() == gs::runtime::RTAnyType::kStringValue) {
auto str = val.as_string();
const_value->mutable_str()->assign(str.data(), str.size());
const_value->set_str(std::string(val.as_string()));
} else if (val.type() == gs::runtime::RTAnyType::kF64Value) {
const_value->set_f64(val.as_double());
} else if (val.type() == gs::runtime::RTAnyType::kBoolValue) {
Expand Down
6 changes: 3 additions & 3 deletions flex/engines/graph_db/runtime/common/rt_any.cc
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ void RTAny::sink_impl(common::Value* value) const {
if (type_ == RTAnyType::kI64Value) {
value->set_i64(value_.i64_val);
} else if (type_ == RTAnyType::kStringValue) {
value->mutable_str()->assign(value_.str_val.data(), value_.str_val.size());
value->set_str(value_.str_val.data(), value_.str_val.size());
} else if (type_ == RTAnyType::kI32Value) {
value->set_i32(value_.i32_val);
} else if (type_ == RTAnyType::kStringSetValue) {
Expand Down Expand Up @@ -582,7 +582,7 @@ static void sink_any(const Any& any, common::Value* value) {
value->set_i64(any.AsInt64());
} else if (any.type == PropertyType::StringView()) {
auto str = any.AsStringView();
value->mutable_str()->assign(str.data(), str.size());
value->set_str(str.data(), str.size());
} else if (any.type == PropertyType::Date()) {
value->set_i64(any.AsDate().milli_second);
} else if (any.type == PropertyType::Int32()) {
Expand Down Expand Up @@ -648,7 +648,7 @@ void RTAny::sink(const gs::ReadTransaction& txn, int id,
continue;
}
auto ret = mp->add_key_values();
ret->mutable_key()->mutable_str()->assign(keys[i].data(), keys[i].size());
ret->mutable_key()->set_str(keys[i]);
if (vals[i].type_ == RTAnyType::kVertex) {
auto v = ret->mutable_value()->mutable_element()->mutable_vertex();
sink_vertex(txn, vals[i].as_vertex(), v);
Expand Down
5 changes: 2 additions & 3 deletions flex/engines/hqps_db/core/operator/sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ template <typename T,
typename std::enable_if<
(std::is_same_v<T, std::string_view>)>::type* = nullptr>
void template_set_value(common::Value* value, T v) {
value->mutable_str()->assign(v.data(), v.size());
value->set_str(v.data(), v.size());
}

template <typename T, typename std::enable_if<
Expand Down Expand Up @@ -233,8 +233,7 @@ void template_set_key_value(results::KeyValues* map,
const VariableKeyValue& key_value) {
for (auto& kv : key_value) {
auto cur_kv = map->add_key_values();
cur_kv->mutable_key()->mutable_str()->assign(kv.first.data(),
kv.first.size());
cur_kv->mutable_key()->set_name(kv.first);
auto value = cur_kv->mutable_value()->mutable_element();
set_any_to_element(kv.second, value);
}
Expand Down
Loading

0 comments on commit ef624b2

Please sign in to comment.