Decode Arrow IPC stream bytes back into a RecordBatch. Used by the Control Plane to receive Arrow data from the Data Plane across the SPSC bridge.
(bytes: &[u8])
| 235 | /// Used by the Control Plane to receive Arrow data from the Data Plane |
| 236 | /// across the SPSC bridge. |
| 237 | pub fn decode_arrow_ipc(bytes: &[u8]) -> Option<RecordBatch> { |
| 238 | use arrow::ipc::reader::StreamReader; |
| 239 | let cursor = std::io::Cursor::new(bytes); |
| 240 | let mut reader = StreamReader::try_new(cursor, None).ok()?; |
| 241 | reader.next()?.ok() |
| 242 | } |
| 243 | |
| 244 | #[cfg(test)] |
| 245 | mod tests { |