MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / MakeResultSet

Method MakeResultSet

src/sdk/result_set_sql.cc:46–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46std::shared_ptr<::hybridse::sdk::ResultSet> ResultSetSQL::MakeResultSet(
47 const std::shared_ptr<::fedb::api::QueryResponse>& response, const std::shared_ptr<brpc::Controller>& cntl,
48 hybridse::sdk::Status* status) {
49 if (!status || !response || !cntl) {
50 return std::shared_ptr<ResultSet>();
51 }
52 ::hybridse::vm::Schema schema;
53 bool ok = ::hybridse::codec::SchemaCodec::Decode(response->schema(), &schema);
54 if (!ok) {
55 status->code = -1;
56 status->msg = "request error, fail to decodec schema";
57 return std::shared_ptr<ResultSet>();
58 }
59 std::shared_ptr<::fedb::sdk::ResultSetSQL> rs =
60 std::make_shared<fedb::sdk::ResultSetSQL>(schema, response->count(), response->byte_size(), cntl);
61 ok = rs->Init();
62 if (!ok) {
63 status->code = -1;
64 status->msg = "request error, resuletSetSQL init failed";
65 return std::shared_ptr<ResultSet>();
66 }
67 return rs;
68}
69
70std::shared_ptr<::hybridse::sdk::ResultSet> ResultSetSQL::MakeResultSet(
71 const std::shared_ptr<::fedb::api::ScanResponse>& response,

Callers

nothing calls this directly

Calls 5

DecodeFunction · 0.85
InitMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45
GetSchemaMethod · 0.45

Tested by

no test coverage detected