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

Function test_execute_ingest

arrow-flight/tests/flight_sql_client.rs:76–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74
75#[tokio::test]
76pub async fn test_execute_ingest() {
77 let test_server = FlightSqlServiceImpl::new();
78 let fixture = TestFixture::new(test_server.service()).await;
79 let channel = fixture.channel().await;
80 let mut flight_sql_client = FlightSqlServiceClient::new(channel);
81 let cmd = make_ingest_command();
82 let expected_rows = 10;
83 let batches = vec![
84 make_primitive_batch(5),
85 make_primitive_batch(3),
86 make_primitive_batch(2),
87 ];
88 let actual_rows = flight_sql_client
89 .execute_ingest(cmd, futures::stream::iter(batches.clone()).map(Ok))
90 .await
91 .expect("ingest should succeed");
92 assert_eq!(actual_rows, expected_rows);
93 // make sure the batches made it through to the server
94 let ingested_batches = test_server.ingested_batches.lock().await.clone();
95 assert_eq!(ingested_batches, batches);
96}
97
98#[tokio::test]
99pub async fn test_execute_ingest_error() {

Callers

nothing calls this directly

Calls 5

make_ingest_commandFunction · 0.85
execute_ingestMethod · 0.80
serviceMethod · 0.45
channelMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected