From 6b6f148dc36aae7d3ee5f08c5ad4ce0db76797ad Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Sun, 5 Jun 2022 13:27:07 -0700 Subject: [PATCH] Add test --- arrow/src/ipc/reader.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arrow/src/ipc/reader.rs b/arrow/src/ipc/reader.rs index ccb0dfbb047c..9100505e041d 100644 --- a/arrow/src/ipc/reader.rs +++ b/arrow/src/ipc/reader.rs @@ -1942,4 +1942,17 @@ mod tests { let output_batch = roundtrip_ipc_stream(&input_batch); assert_eq!(input_batch, output_batch); } + + #[test] + fn test_no_columns_batch() { + let schema = Arc::new(Schema::new(vec![])); + let options = RecordBatchOptions { + match_field_names: true, + row_count: Some(10), + }; + let input_batch = + RecordBatch::try_new_with_options(schema, vec![], &options).unwrap(); + let output_batch = roundtrip_ipc_stream(&input_batch); + assert_eq!(input_batch, output_batch); + } }