Akanksha-kedia commented on code in PR #18454:
URL: https://github.com/apache/pinot/pull/18454#discussion_r3387500876


##########
pinot-plugins/pinot-file-system/pinot-adls/src/main/java/org/apache/pinot/plugin/filesystem/ADLSGen2PinotFS.java:
##########
@@ -651,7 +659,17 @@ public boolean touch(URI uri)
     try {
       DataLakeFileClient fileClient =
           
_fileSystemClient.getFileClient(AzurePinotFSUtil.convertUriToAzureStylePath(uri));
-      PathProperties pathProperties = fileClient.getProperties();
+      PathProperties pathProperties;
+      try {
+        pathProperties = fileClient.getProperties();
+      } catch (DataLakeStorageException e) {
+        if (e.getStatusCode() == NOT_FOUND_STATUS_CODE) {
+          // File does not exist — create an empty file to satisfy the PinotFS 
touch() contract
+          
_fileSystemClient.createFile(AzurePinotFSUtil.convertUriToAzureStylePath(uri));

Review Comment:
   Added unit tests in the latest commit covering all the branches you flagged:
   - `testOpenFileNotFound()` — 404 → `FileNotFoundException`
   - `testLastModifiedFileNotFound()` — 404 → returns `0L`
   - `testLastModifiedNullDateTime()` — null `OffsetDateTime` → returns `0L`
   - `testIsDirectoryNullMetadata()` — null metadata map → returns `false`
   - `testListFilesWithMetadataNullLastModified()` — null `getLastModified()` → 
`lastModifiedTime = 0L`
   - `testTouchFileNotFound()` — 404 on `getProperties()` → calls 
`createFile()` and returns `true`
   
   Each test uses the existing mock infrastructure and strict 
`verifyNoMoreInteractions` to ensure correctness. @noob-se7en please re-review.



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