tanmayrauth commented on code in PR #917:
URL: https://github.com/apache/iceberg-go/pull/917#discussion_r3101710826
##########
io/gocloud/blob.go:
##########
@@ -190,6 +191,24 @@ func createBlobFS(ctx context.Context, bucket
*blob.Bucket, keyExtractor KeyExtr
return &blobFileIO{Bucket: bucket, keyExtractor: keyExtractor, ctx: ctx}
}
+func (bfs *blobFileIO) WalkDir(root string, fn fs.WalkDirFunc) error {
+ parsed, err := url.Parse(root)
+ if err != nil {
+ return fmt.Errorf("invalid URL %s: %w", root, err)
+ }
+
+ walkPath := strings.TrimPrefix(parsed.Path, "/")
+ if walkPath == "" {
+ walkPath = "."
+ }
+
+ prefix := parsed.Scheme + "://" + parsed.Host + "/"
+
+ return fs.WalkDir(bfs.Bucket, walkPath, func(path string, d
fs.DirEntry, err error) error {
+ return fn(prefix+path, d, err)
+ })
+}
Review Comment:
fixed. Now uses parsed.User to preserve the userinfo component. Added a
dedicated test for abfs://[email protected]/... URIs.
--
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]