| 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() { |