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

Method fake_flight_info

arrow-flight/tests/flight_sql_client_cli.rs:425–452  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

423 }
424
425 fn fake_flight_info(&self) -> Result<FlightInfo, ArrowError> {
426 let batch = Self::fake_result()?;
427
428 Ok(FlightInfo::new()
429 .try_with_schema(batch.schema_ref())
430 .expect("encoding schema")
431 .with_endpoint(
432 FlightEndpoint::new().with_ticket(Ticket::new(
433 FetchResults {
434 handle: String::from("part_1"),
435 }
436 .as_any()
437 .encode_to_vec(),
438 )),
439 )
440 .with_endpoint(
441 FlightEndpoint::new().with_ticket(Ticket::new(
442 FetchResults {
443 handle: String::from("part_2"),
444 }
445 .as_any()
446 .encode_to_vec(),
447 )),
448 )
449 .with_total_records(batch.num_rows() as i64)
450 .with_total_bytes(batch.get_array_memory_size() as i64)
451 .with_ordered(false))
452 }
453}
454
455fn serialize_schema(schema: &Schema) -> Result<Bytes, ArrowError> {

Calls 10

with_orderedMethod · 0.80
with_total_bytesMethod · 0.80
with_total_recordsMethod · 0.80
with_endpointMethod · 0.80
try_with_schemaMethod · 0.80
schema_refMethod · 0.80
with_ticketMethod · 0.80
as_anyMethod · 0.45
num_rowsMethod · 0.45
get_array_memory_sizeMethod · 0.45

Tested by

no test coverage detected