Copilot commented on code in PR #19250:
URL: https://github.com/apache/pinot/pull/19250#discussion_r3778250693


##########
pinot-spi/src/main/java/org/apache/pinot/spi/filesystem/LocalPinotFS.java:
##########
@@ -115,7 +115,8 @@ public String[] listFiles(URI fileUri, boolean recursive)
       throws IOException {
     File file = toFile(fileUri);
     if (!recursive) {
-      return Arrays.stream(file.list()).map(s -> new File(file, 
s)).map(File::getAbsolutePath).toArray(String[]::new);
+      return Arrays.stream(listFileNames(file)).map(s -> new File(file, 
s)).map(File::getAbsolutePath)
+          .toArray(String[]::new);

Review Comment:
   The invalid-directory handling remains mode-dependent here. `Files.walk()` 
accepts a regular file as its root; the subsequent filter removes that sole 
path, so `listFiles(fileUri, true)` returns an empty array instead of the 
`IOException` now produced for `recursive=false`. Add a directory guard for the 
recursive path (and cover this case in the regression test).
   
   This issue also appears on line 132 of the same file.



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