zeroshade commented on code in PR #1378:
URL: https://github.com/apache/iceberg-go/pull/1378#discussion_r3523576702


##########
table/internal/parquet_files.go:
##########
@@ -74,12 +74,18 @@ const (
 
 type parquetFormat struct{}
 
-func (parquetFormat) Open(ctx context.Context, fs iceio.IO, path string) 
(FileReader, error) {
+func (parquetFormat) Open(ctx context.Context, fs iceio.IO, path string) 
(result FileReader, err error) {
        inputfile, err := fs.Open(path)
        if err != nil {
                return nil, err
        }
 
+       defer func() {
+               if err != nil {
+                       _ = inputfile.Close()

Review Comment:
   This cleanup path closes the input file on reader initialization errors, but 
it drops any Close error. Elsewhere in this file cleanup failures are 
aggregated with errors.Join; please preserve that behavior here too, e.g. `if 
closeErr := inputfile.Close(); closeErr != nil { err = errors.Join(err, 
closeErr) }`.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to