Akanksha-kedia opened a new pull request, #18457:
URL: https://github.com/apache/pinot/pull/18457

   ## Summary
   
   Four independent issues in `HadoopPinotFS`:
   
   1. **`visitFileStatus()` — null return from `listStatus()`**
      `FileSystem.listStatus()` can return `null` on some Hadoop versions when 
the path is empty or inaccessible. Iterating over a null array causes NPE. 
Added an early-return null guard.
   
   2. **`isDirectory()` / `lastModified()` — `RuntimeException` wrapping**
      Both methods catch `IOException` and rethrow wrapped in 
`RuntimeException`. The `PinotFS` interface declares both as `throws 
IOException`, so the checked exception should propagate directly. Removed the 
wrapping and added `throws IOException` to the overrides.
   
   3. **`touch()` — `FSDataOutputStream` resource leak**
      `FSDataOutputStream fos = _hadoopFS.create(path); fos.close();` — if 
`fos.close()` throws, the stream leaks. Replaced with try-with-resources.
   
   4. **`close()` — NPE when `init()` was never called**
      If `init()` never ran or threw before assigning `_hadoopFS`, `close()` 
throws NPE. Added a null guard before calling `_hadoopFS.close()`.
   
   ## Test plan
   
   - [ ] Existing unit tests for `HadoopPinotFS` pass
   - [ ] `listStatus` returning `null` no longer causes NPE in `listFiles` / 
`listFilesWithMetadata`
   - [ ] `isDirectory` and `lastModified` propagate `IOException` to callers 
instead of `RuntimeException`


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