MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_select

Function test_select

arrow-flight/examples/flight_sql_server.rs:967–991  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

965
966 #[tokio::test]
967 async fn test_select() {
968 test_all_clients(|mut client| async move {
969 auth_client(&mut client).await;
970
971 let mut stmt = client.prepare("select 1;".to_string(), None).await.unwrap();
972
973 let flight_info = stmt.execute().await.unwrap();
974
975 let ticket = flight_info.endpoint[0].ticket.as_ref().unwrap().clone();
976 let flight_data = client.do_get(ticket).await.unwrap();
977 let batches: Vec<_> = flight_data.try_collect().await.unwrap();
978
979 let res = pretty_format_batches(batches.as_slice()).unwrap();
980 let expected = r#"
981+-------------------+
982| salutation |
983+-------------------+
984| Hello, FlightSQL! |
985+-------------------+"#
986 .trim()
987 .to_string();
988 assert_eq!(res.to_string(), expected);
989 })
990 .await
991 }
992
993 #[tokio::test]
994 async fn test_execute_update() {

Callers

nothing calls this directly

Calls 10

test_all_clientsFunction · 0.85
auth_clientFunction · 0.85
pretty_format_batchesFunction · 0.85
executeMethod · 0.80
trimMethod · 0.80
prepareMethod · 0.45
cloneMethod · 0.45
as_refMethod · 0.45
do_getMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected