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

Method GetResultSet

src/sdk/sql_cluster_router.cc:142–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 }
141
142 std::shared_ptr<hybridse::sdk::ResultSet> GetResultSet(hybridse::sdk::Status* status) override {
143 if (!status) {
144 return nullptr;
145 }
146 if (!callback_ || !callback_->GetResponse() || !callback_->GetController()) {
147 status->code = hybridse::common::kRpcError;
148 status->msg = "request error, response or controller null";
149 return nullptr;
150 }
151 brpc::Join(callback_->GetController()->call_id());
152 if (callback_->GetController()->Failed()) {
153 status->code = hybridse::common::kRpcError;
154 status->msg = "request error. " + callback_->GetController()->ErrorText();
155 return nullptr;
156 }
157 std::shared_ptr<::fedb::sdk::SQLBatchRequestResultSet> rs =
158 std::make_shared<fedb::sdk::SQLBatchRequestResultSet>(
159 callback_->GetResponse(), callback_->GetController());
160 bool ok = rs->Init();
161 if (!ok) {
162 status->code = -1;
163 status->msg = "request error, resuletSetSQL init failed";
164 return nullptr;
165 }
166 return rs;
167 }
168
169 bool IsDone() const override {
170 return callback_->IsDone();

Callers

nothing calls this directly

Calls 1

InitMethod · 0.45

Tested by

no test coverage detected