From 0c72501fc64f1dd88f6aa59a695908f1b67e738a Mon Sep 17 00:00:00 2001 From: liukun4515 Date: Wed, 31 Aug 2022 15:40:55 +0800 Subject: [PATCH] fix lint --- arrow-flight/src/lib.rs | 6 +++--- arrow/src/ipc/convert.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arrow-flight/src/lib.rs b/arrow-flight/src/lib.rs index 738bd7e74b0..54f4d24b65a 100644 --- a/arrow-flight/src/lib.rs +++ b/arrow-flight/src/lib.rs @@ -452,16 +452,16 @@ mod tests { Field::new("c5", DataType::Timestamp(TimeUnit::Millisecond, None), true), Field::new("c6", DataType::Time32(TimeUnit::Second), false), ]); - // V5 + // V5 with write_legacy_ipc_format = false + // this will write the continuation marker let option = IpcWriteOptions::default(); let schema_ipc = SchemaAsIpc::new(&schema, &option); let result: SchemaResult = schema_ipc.try_into().unwrap(); - // let des_schema: Schema = (&result).try_into().unwrap(); assert_eq!(schema, des_schema); // V4 with write_legacy_ipc_format = true - // This will write the continuation marker + // this will not write the continuation marker let option = IpcWriteOptions::try_new(8, true, MetadataVersion::V4).unwrap(); let schema_ipc = SchemaAsIpc::new(&schema, &option); let result: SchemaResult = schema_ipc.try_into().unwrap(); diff --git a/arrow/src/ipc/convert.rs b/arrow/src/ipc/convert.rs index 158a756ce4d..218d495113d 100644 --- a/arrow/src/ipc/convert.rs +++ b/arrow/src/ipc/convert.rs @@ -188,9 +188,9 @@ pub fn try_schema_from_ipc_buffer(buffer: &[u8]) -> Result { })?; Ok(fb_to_schema(ipc_schema)) } else { - Err(ArrowError::ParseError(format!( - "The buffer length is less than 4, parser buffer to Schema" - ))) + Err(ArrowError::ParseError( + "The buffer length is less than 4 and missing the continuation maker or length of buffer".to_string() + )) } }