| 171 | }; |
| 172 | |
| 173 | TEST_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 | |
| 198 | TEST_F(TestFlightSqlServer, TestCommandGetTables) { |
| 199 | FlightCallOptions options = {}; |
no test coverage detected