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

Function verify_flight_round_trip

arrow-flight/src/encode.rs:1755–1777  ·  view source on GitHub ↗
(mut batches: Vec<RecordBatch>)

Source from the content-addressed store, hash-verified

1753 }
1754
1755 async fn verify_flight_round_trip(mut batches: Vec<RecordBatch>) {
1756 let expected_schema = batches.first().unwrap().schema();
1757
1758 let encoder = FlightDataEncoderBuilder::default()
1759 .with_options(IpcWriteOptions::default())
1760 .with_dictionary_handling(DictionaryHandling::Resend)
1761 .build(futures::stream::iter(batches.clone().into_iter().map(Ok)));
1762
1763 let mut expected_batches = batches.drain(..);
1764
1765 let mut decoder = FlightDataDecoder::new(encoder);
1766 while let Some(decoded) = decoder.next().await {
1767 let decoded = decoded.unwrap();
1768 match decoded.payload {
1769 DecodedPayload::None => {}
1770 DecodedPayload::Schema(s) => assert_eq!(s, expected_schema),
1771 DecodedPayload::RecordBatch(b) => {
1772 let expected_batch = expected_batches.next().unwrap();
1773 assert_eq!(b, expected_batch);
1774 }
1775 }
1776 }
1777 }
1778
1779 #[test]
1780 fn test_schema_metadata_encoded() {

Calls 9

defaultFunction · 0.85
firstMethod · 0.80
with_optionsMethod · 0.80
schemaMethod · 0.45
buildMethod · 0.45
into_iterMethod · 0.45
cloneMethod · 0.45
nextMethod · 0.45