This is an automated email from the ASF dual-hosted git repository.
yashmayya pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new cc26228a165 Return false from HadoopPinotFS.isDirectory for missing
paths (#18626)
cc26228a165 is described below
commit cc26228a165be005d18b12739f710a17f12bd113
Author: Cc <[email protected]>
AuthorDate: Mon Jun 1 06:57:46 2026 +0800
Return false from HadoopPinotFS.isDirectory for missing paths (#18626)
Co-authored-by: wolfkill <[email protected]>
---
.../org/apache/pinot/plugin/filesystem/HadoopPinotFS.java | 6 +++++-
.../org/apache/pinot/plugin/filesystem/HadoopPinotFSTest.java | 11 +++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git
a/pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java
b/pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java
index be2aa28ec61..6da773e62fb 100644
---
a/pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java
+++
b/pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java
@@ -239,7 +239,11 @@ public class HadoopPinotFS extends BasePinotFS {
@Override
public boolean isDirectory(URI uri)
throws IOException {
- return _hadoopFS.getFileStatus(new Path(uri)).isDirectory();
+ try {
+ return _hadoopFS.getFileStatus(new Path(uri)).isDirectory();
+ } catch (FileNotFoundException e) {
+ return false;
+ }
}
@Override
diff --git
a/pinot-plugins/pinot-file-system/pinot-hdfs/src/test/java/org/apache/pinot/plugin/filesystem/HadoopPinotFSTest.java
b/pinot-plugins/pinot-file-system/pinot-hdfs/src/test/java/org/apache/pinot/plugin/filesystem/HadoopPinotFSTest.java
index 9c5f7d9d576..b6638a1b991 100644
---
a/pinot-plugins/pinot-file-system/pinot-hdfs/src/test/java/org/apache/pinot/plugin/filesystem/HadoopPinotFSTest.java
+++
b/pinot-plugins/pinot-file-system/pinot-hdfs/src/test/java/org/apache/pinot/plugin/filesystem/HadoopPinotFSTest.java
@@ -151,6 +151,17 @@ public class HadoopPinotFSTest {
}
}
+ @Test
+ public void testIsDirectoryReturnsFalseForNonExistentPath()
+ throws IOException {
+ URI missingPath = URI.create(TMP_DIR +
"/testIsDirectoryReturnsFalseForNonExistentPath/missing");
+ try (HadoopPinotFS hadoopFS = new HadoopPinotFS()) {
+ hadoopFS.init(new PinotConfiguration());
+
+ Assert.assertFalse(hadoopFS.isDirectory(missingPath));
+ }
+ }
+
@Test
public void testDeleteBatchWithEmptyList()
throws IOException {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]