MCPcopy Create free account
hub / github.com/apache/arrow / EnsureDataStarted

Method EnsureDataStarted

cpp/src/arrow/flight/client.cc:190–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188 app_metadata_(nullptr) {}
189
190 Status EnsureDataStarted() {
191 if (!batch_reader_) {
192 bool skipped_to_data = false;
193 skipped_to_data = peekable_reader_->SkipToData();
194 // peek() until we find the first data message; discard metadata
195 if (!skipped_to_data) {
196 return OverrideWithServerError(MakeFlightError(
197 FlightStatusCode::Internal, "Server never sent a data message"));
198 }
199
200 auto message_reader = std::unique_ptr<ipc::MessageReader>(new IpcMessageReader(
201 stream_, peekable_reader_, memory_manager_, &app_metadata_));
202 auto result =
203 ipc::RecordBatchStreamReader::Open(std::move(message_reader), options_);
204 RETURN_NOT_OK(OverrideWithServerError(std::move(result).Value(&batch_reader_)));
205 }
206 return Status::OK();
207 }
208 arrow::Result<std::shared_ptr<Schema>> GetSchema() override {
209 RETURN_NOT_OK(EnsureDataStarted());
210 return batch_reader_->schema();

Callers 1

DoGetMethod · 0.45

Calls 4

MakeFlightErrorFunction · 0.85
SkipToDataMethod · 0.80
OKFunction · 0.50
ValueMethod · 0.45

Tested by

no test coverage detected