eyalleshem commented on a change in pull request #7384:
URL: https://github.com/apache/arrow/pull/7384#discussion_r439304801



##########
File path: rust/arrow/src/ipc/reader.rs
##########
@@ -793,7 +793,21 @@ impl<R: Read> StreamReader<R> {
         }
         // determine metadata length
         let mut meta_size: [u8; 4] = [0; 4];
-        self.reader.read_exact(&mut meta_size)?;
+
+        match self.reader.read_exact(&mut meta_size) {
+            Ok(()) => (),
+            Err(e) => {
+                if e.kind() == std::io::ErrorKind::UnexpectedEof {
+                    // Handle EOF without the "0xFFFFFFFF 0x00000000"
+                    // valid according to:
+                    // 
https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format
+                    self.finished = true;
+                    return Ok(None);
+                }
+                return Err(ArrowError::from(e));

Review comment:
       done 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to