diff --git a/hoodie-common/src/main/java/com/uber/hoodie/exception/DatasetNotFoundException.java b/hoodie-common/src/main/java/com/uber/hoodie/exception/DatasetNotFoundException.java index 701f0162f..476ebddde 100644 --- a/hoodie-common/src/main/java/com/uber/hoodie/exception/DatasetNotFoundException.java +++ b/hoodie-common/src/main/java/com/uber/hoodie/exception/DatasetNotFoundException.java @@ -46,7 +46,11 @@ public class DatasetNotFoundException extends HoodieException { if (!fs.exists(metaPathDir) || !fs.isDirectory(metaPathDir)) { throw new DatasetNotFoundException(metaPathDir.toString()); } - } catch (IOException e) { + } catch (IllegalArgumentException e) { + // if the base path is file:///, then we have a IllegalArgumentException + throw new DatasetNotFoundException(metaPathDir.toString()); + } + catch (IOException e) { throw new HoodieIOException( "Could not check if dataset " + basePathDir + " is valid dataset", e); } diff --git a/hoodie-hadoop-mr/src/test/java/com/uber/hoodie/hadoop/TestHoodieROTablePathFilter.java b/hoodie-hadoop-mr/src/test/java/com/uber/hoodie/hadoop/TestHoodieROTablePathFilter.java index 52fff93c5..7470e6bbb 100644 --- a/hoodie-hadoop-mr/src/test/java/com/uber/hoodie/hadoop/TestHoodieROTablePathFilter.java +++ b/hoodie-hadoop-mr/src/test/java/com/uber/hoodie/hadoop/TestHoodieROTablePathFilter.java @@ -52,11 +52,11 @@ public class TestHoodieROTablePathFilter { Path partitionPath = new Path("file://" + basePath + File.separator + "2017/01/01"); assertTrue("Directories should be accepted", pathFilter.accept(partitionPath)); - assertTrue(pathFilter.accept(new Path("file://" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "001", "f1")))); - assertFalse(pathFilter.accept(new Path("file://" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "001", "f2")))); - assertTrue(pathFilter.accept(new Path("file://" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "001", "f3")))); - assertTrue(pathFilter.accept(new Path("file://" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "002", "f2")))); - assertFalse(pathFilter.accept(new Path("file://" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "003", "f3")))); + assertTrue(pathFilter.accept(new Path("file:///" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "001", "f1")))); + assertFalse(pathFilter.accept(new Path("file:///" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "001", "f2")))); + assertTrue(pathFilter.accept(new Path("file:///" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "001", "f3")))); + assertTrue(pathFilter.accept(new Path("file:///" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "002", "f2")))); + assertFalse(pathFilter.accept(new Path("file:///" + HoodieTestUtils.getDataFilePath(basePath, "2017/01/01", "003", "f3")))); } @Test @@ -68,10 +68,10 @@ public class TestHoodieROTablePathFilter { String path = basePath + File.separator + "nonhoodiefolder"; new File(path).mkdirs(); - assertTrue(pathFilter.accept(new Path("file://" + path))); + assertTrue(pathFilter.accept(new Path("file:///" + path))); path = basePath + File.separator + "nonhoodiefolder/somefile"; new File(path).createNewFile(); - assertTrue(pathFilter.accept(new Path("file://" + path))); + assertTrue(pathFilter.accept(new Path("file:///" + path))); } }