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

Function TEST_F

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

Source from the content-addressed store, hash-verified

171};
172
173TEST_F(TestFlightSqlServer, TestCommandStatementQuery) {
174 ASSERT_OK_AND_ASSIGN(auto flight_info,
175 sql_client->Execute({}, "SELECT * FROM intTable"));
176
177 ASSERT_OK_AND_ASSIGN(auto stream,
178 sql_client->DoGet({}, flight_info->endpoints()[0].ticket));
179
180 ASSERT_OK_AND_ASSIGN(auto table, stream->ToTable());
181
182 const std::shared_ptr<Schema>& expected_schema =
183 arrow::schema({arrow::field("id", int64()), arrow::field("keyName", utf8()),
184 arrow::field("value", int64()), arrow::field("foreignId", int64())});
185
186 const auto id_array = ArrayFromJSON(int64(), R"([1, 2, 3, 4, 5])");
187 const auto keyname_array =
188 ArrayFromJSON(utf8(), R"(["one", "zero", "negative one", null, "null"])");
189 const auto value_array = ArrayFromJSON(int64(), R"([1, 0, -1, null, null])");
190 const auto foreignId_array = ArrayFromJSON(int64(), R"([1, 1, 1, null, null])");
191
192 const std::shared_ptr<Table>& expected_table = Table::Make(
193 expected_schema, {id_array, keyname_array, value_array, foreignId_array});
194
195 AssertTablesEqual(*expected_table, *table);
196}
197
198TEST_F(TestFlightSqlServer, TestCommandGetTables) {
199 FlightCallOptions options = {};

Callers 3

acero_test.ccFile · 0.70
ASSERT_OK_AND_ASSIGNMethod · 0.50
TESTFunction · 0.50

Calls 15

ArrayFromJSONFunction · 0.85
AssertTablesEqualFunction · 0.85
GetColumnMetadataFunction · 0.85
TableFromJSONFunction · 0.85
GetUnknownColumnDataTypeFunction · 0.85
RecordBatchFromJSONFunction · 0.85
GetSqlInfoResultMapFunction · 0.85
SetParametersMethod · 0.80
push_backMethod · 0.80
CancelQueryMethod · 0.80
schemaFunction · 0.50
fieldFunction · 0.50

Tested by

no test coverage detected