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

Method ExecuteCountQuery

cpp/src/arrow/flight/sql/server_test.cc:135–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 std::unique_ptr<FlightSqlClient> sql_client;
134
135 arrow::Result<int64_t> ExecuteCountQuery(const std::string& query) {
136 ARROW_ASSIGN_OR_RAISE(auto flight_info, sql_client->Execute({}, query));
137
138 ARROW_ASSIGN_OR_RAISE(auto stream,
139 sql_client->DoGet({}, flight_info->endpoints()[0].ticket));
140
141 ARROW_ASSIGN_OR_RAISE(auto table, stream->ToTable());
142
143 const std::shared_ptr<Array>& result_array = table->column(0)->chunk(0);
144 ARROW_ASSIGN_OR_RAISE(auto count_scalar, result_array->GetScalar(0));
145
146 return reinterpret_cast<Int64Scalar&>(*count_scalar).value;
147 }
148
149 protected:
150 void SetUp() override {

Callers

nothing calls this directly

Calls 1

columnMethod · 0.45

Tested by

no test coverage detected