nnguyen168 opened a new pull request, #16595:
URL: https://github.com/apache/iceberg/pull/16595

   ## Summary
   
   This PR adds trailing slash normalization to 
`listDirRecursivelyWithHadoop()` for consistent path handling and proper 
credential scoping. This matches the existing behavior in 
`listDirRecursivelyWithFileIO()`.
   
   **Problem:** Without the trailing slash, listing `s3://bucket/table` could 
potentially:
   1. Include files from sibling directories like `s3://bucket/table-backup/`
   2. Fail due to credential scoping issues when credentials are scoped to 
`s3://bucket/table/`
   
   **Solution:** Normalize the directory path to ensure it ends with `/` before 
listing, consistent with the FileIO implementation.
   
   ## Changes
   
   - **`FileSystemWalker.java`**: Added trailing slash normalization to 
`listDirRecursivelyWithHadoop()` (lines 115-120)
   - **`TestFileSystemWalker.java`**: Added regression test 
`testListDirRecursivelyWithHadoopNoTrailingSlash()`
   
   Closes #16493
   
   ## Test plan
   
   - [x] Added unit test `testListDirRecursivelyWithHadoopNoTrailingSlash()` to 
verify paths without trailing slash are handled correctly
   - [ ] CI should run existing `TestFileSystemWalker` tests to ensure no 
regressions


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