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

   ## Summary
   
   Multiple null-safety and `PinotFS` contract violations in `ADLSGen2PinotFS`:
   
   - **`isDirectory()`**: `pathProperties.getMetadata()` can return `null`, 
causing NPE when accessing `IS_DIRECTORY_KEY`. Added a null guard; returns 
`false` when metadata is absent.
   - **`lastModified()`**: propagated a `DataLakeStorageException` for 404 
(missing file) and called `.toInstant()` on a potentially null 
`OffsetDateTime`. Now returns `0L` for 404 and for a null timestamp, matching 
the `PinotFS` contract.
   - **`touch()`**: threw an exception when the file did not exist instead of 
creating it. The `PinotFS` contract requires `touch()` to create an empty file 
if missing. Now creates the file on 404.
   - **`open()`**: no error handling — a missing file produced an opaque SDK 
exception. Now throws `FileNotFoundException` for 404, matching the `PinotFS` 
contract.
   - **`copySrcToDst()`**: similarly throws `FileNotFoundException` when the 
source is missing (404).
   - **`listFilesWithMetadata()` (both overloads)**: 
`PathItem.getLastModified()` can be null; calling `.toInstant()` on it caused 
NPE. Added null check defaulting to `0L`.
   
   ## Test plan
   
   - [ ] Existing unit/integration tests for `ADLSGen2PinotFS` pass
   - [ ] `touch()` on a non-existent path creates an empty file (consistent 
with `GcsPinotFS`)
   - [ ] `lastModified()` returns `0L` for a missing path (consistent with 
`PinotFS` contract)
   - [ ] `open()` on a missing path throws `FileNotFoundException`


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