lostluck commented on code in PR #26524:
URL: https://github.com/apache/beam/pull/26524#discussion_r1194395867


##########
sdks/go/pkg/beam/io/fileio/match.go:
##########
@@ -190,21 +194,45 @@ func metadataFromFiles(
                        return nil, err
                }
 
+               mTime, err := lastModified(ctx, fs, path)
+               if err != nil {
+                       return nil, err
+               }
+
                metadata[i] = FileMetadata{
-                       Path: path,
-                       Size: size,
+                       Path:         path,
+                       Size:         size,
+                       LastModified: mTime,
                }
        }
 
        return metadata, nil
 }
 
+func lastModified(ctx context.Context, fs filesystem.Interface, path string) 
(time.Time, error) {

Review Comment:
   Not in this PR, but we could consider putting this as a helper function in 
the filesystem package instead, to allow more reasonable re-use and consistency 
in the implementation:
   
   Eg. We implement copy, but if there's a Copier implementation, it can be 
used instead.
   
https://github.com/apache/beam/blob/master/sdks/go/pkg/beam/io/filesystem/util.go#L55
   
   We'd probably want a "creation time" too though when we do that, so the 
default isn't the zero time. Not critical at this stage though.



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