Revanth14 opened a new pull request, #2218:
URL: https://github.com/apache/iceberg-go/pull/2218
## Problem
`blobfs.FileIO.WalkDir("s3://bucket/tbl/")` failed with `stat tbl/: invalid
argument` before visiting anything: the key `tbl/` went straight to
`fs.WalkDir`, which rejects it via `fs.ValidPath`. Orphan cleanup returns walk
errors, so a cleanup location written with a trailing slash failed the whole
scan.
## Fix
`WalkDir` trims trailing `/` from the key before walking. A key that is
empty after trimming walks the bucket root, as an empty key already does.
Walked paths come back without the slash, so reported URIs are the same as for
the root without one.
## Testing
`TestBlobFileIOWalkDirTrailingSlashRoot` walks `tbl`, `tbl/` and `tbl//` and
checks all three report the same paths. Without the trim it fails with the
reported error. `go test -race ./io/... ./table/maintenance/...` passes.
--
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]