tschaub opened a new issue, #39647:
URL: https://github.com/apache/arrow/issues/39647

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   The Parquet `file.Reader` does not consistently check for `io.EOF` when 
reading from the end of a file.  If a reader returns `io.EOF` in cases where 
the footer bytes have been successfully read, the Parquet `file.Reader` does 
not successfully parse the footer metadata.  This is legitimate behavior from 
an `io.Reader` as described [in the docs](https://pkg.go.dev/io#Reader):
   > When Read encounters an error or end-of-file condition after successfully 
reading n > 0 bytes, it returns the number of bytes read. It may return the 
(non-nil) error from the same call or return the error (and n == 0) from a 
subsequent call. An instance of this general case is that a Reader returning a 
non-zero number of bytes at the end of the input stream may return either err 
== EOF or err == nil.
   
   Here is an example where the `file.Reader` does allow for `io.EOF`: 
https://github.com/apache/arrow/blob/apache-arrow-15.0.0/go/parquet/file/file_reader.go#L165-L168
   
   Here is an example where the `file.Reader` does not allow for `io.EOF`: 
https://github.com/apache/arrow/blob/apache-arrow-15.0.0/go/parquet/file/file_reader.go#L183-L185
   
   ### Component(s)
   
   Go, Parquet


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to