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

Function flight_data_from_arrow_batch

arrow-flight/src/encode.rs:1810–1831  ·  view source on GitHub ↗
(
        batch: &RecordBatch,
        options: &IpcWriteOptions,
    )

Source from the content-addressed store, hash-verified

1808 }
1809
1810 fn flight_data_from_arrow_batch(
1811 batch: &RecordBatch,
1812 options: &IpcWriteOptions,
1813 ) -> (Vec<FlightData>, FlightData) {
1814 let data_gen = IpcDataGenerator::default();
1815 let mut dictionary_tracker = DictionaryTracker::new(false);
1816 let mut compression_context = CompressionContext::default();
1817
1818 let (encoded_dictionaries, encoded_batch) = data_gen
1819 .encode(
1820 batch,
1821 &mut dictionary_tracker,
1822 options,
1823 &mut compression_context,
1824 )
1825 .expect("DictionaryTracker configured above to not error on replacement");
1826
1827 let flight_dictionaries = encoded_dictionaries.into_iter().map(Into::into).collect();
1828 let flight_batch = encoded_batch.into();
1829
1830 (flight_dictionaries, flight_batch)
1831 }
1832
1833 #[test]
1834 fn test_split_batch_for_grpc_response() {

Callers 1

make_flight_dataFunction · 0.85

Calls 4

defaultFunction · 0.85
collectMethod · 0.80
encodeMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected