jecsand838 commented on code in PR #8100:
URL: https://github.com/apache/arrow-rs/pull/8100#discussion_r2267954606


##########
arrow-avro/src/reader/mod.rs:
##########
@@ -130,6 +129,16 @@ fn read_header<R: BufRead>(mut reader: R) -> 
Result<Header, ArrowError> {
     })
 }
 
+fn is_incomplete_data(err: &ArrowError) -> bool {
+    matches!(
+        err,
+        ArrowError::ParseError(msg)
+            if msg.contains("Unexpected EOF")
+            || msg.contains("bad varint")
+            || msg.contains("offset overflow")

Review Comment:
   I ended up modifying `is_incomplete_data` to this:
   
   ```
   fn is_incomplete_data(err: &ArrowError) -> bool {
       matches!(
           err,
           ArrowError::ParseError(msg)
               if msg.contains("Unexpected EOF")
       )
   }
   ```
   
   I double checked the `arrow-avro/src/reader/cursor.rs` file and we should 
only get the `Unexpected EOF` error if there's too few bytes. 
   
   I'll also improve the logic in `arrow-avro/src/reader/cursor.rs` to support 
a more deliberate and less rigid implementation in a future PR. I left a 
comment in the code calling this out.
   
   Let me know what you think of this approach.



-- 
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.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

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

Reply via email to