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

Function PrintResultsForEndpoint

cpp/src/arrow/flight/sql/test_app_cli.cc:121–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119#endif
120
121Status PrintResultsForEndpoint(FlightSqlClient& client,
122 const FlightCallOptions& call_options,
123 const FlightEndpoint& endpoint) {
124 ARROW_ASSIGN_OR_RAISE(auto stream, client.DoGet(call_options, endpoint.ticket));
125
126 const arrow::Result<std::shared_ptr<Schema>>& schema = stream->GetSchema();
127 ARROW_RETURN_NOT_OK(schema);
128
129 std::cout << "Schema:" << std::endl;
130 std::cout << schema->get()->ToString() << std::endl << std::endl;
131
132 std::cout << "Results:" << std::endl;
133
134 int64_t num_rows = 0;
135
136 while (true) {
137 ARROW_ASSIGN_OR_RAISE(FlightStreamChunk chunk, stream->Next());
138 if (chunk.data == nullptr) {
139 break;
140 }
141 std::cout << chunk.data->ToString() << std::endl;
142 num_rows += chunk.data->num_rows();
143 }
144
145 std::cout << "Total: " << num_rows << std::endl;
146
147 return Status::OK();
148}
149
150Status PrintResults(FlightSqlClient& client, const FlightCallOptions& call_options,
151 const std::unique_ptr<FlightInfo>& info) {

Callers 1

PrintResultsFunction · 0.85

Calls 5

OKFunction · 0.50
GetSchemaMethod · 0.45
ToStringMethod · 0.45
getMethod · 0.45
num_rowsMethod · 0.45

Tested by

no test coverage detected