use of com.facebook.presto.hive.NestedDirectoryPolicy.IGNORED in project presto by prestodb.
the class TestHiveFileIterator method testDefaultPathFilterNoRecursion.
@Test
public void testDefaultPathFilterNoRecursion() throws IOException {
// set up
File rootDir = createTempDir();
String basePath = rootDir.getAbsolutePath();
// create 8 files in root directory - 3 pathFilter matched and 5 non matched files.
createFiles(basePath, 3, true);
createFiles(basePath, 5, false);
Path rootPath = new Path("file://" + basePath + File.separator);
PathFilter pathFilter = path -> true;
HiveFileIterator hiveFileIterator = new HiveFileIterator(rootPath, listDirectoryOperation, new NamenodeStats(), IGNORED, pathFilter);
int actualCount = Iterators.size(hiveFileIterator);
assertEquals(actualCount, 8);
// cleanup
deleteTestDir(rootDir);
}
use of com.facebook.presto.hive.NestedDirectoryPolicy.IGNORED in project presto by prestodb.
the class TestHiveFileIterator method testPathFilterWithNoRecursion.
@Test
public void testPathFilterWithNoRecursion() throws IOException {
// set up
File rootDir = createTempDir();
String basePath = rootDir.getAbsolutePath();
// create 8 files in root directory - 3 pathFilter matched and 5 non matched files.
createFiles(basePath, 3, true);
createFiles(basePath, 5, false);
Path rootPath = new Path("file://" + basePath + File.separator);
PathFilter pathFilter = path -> path.getName().contains(PATH_FILTER_MATCHED_PREFIX);
HiveFileIterator hiveFileIterator = new HiveFileIterator(rootPath, listDirectoryOperation, new NamenodeStats(), IGNORED, pathFilter);
int actualCount = Iterators.size(hiveFileIterator);
assertEquals(actualCount, 3);
// cleanup
deleteTestDir(rootDir);
}
Aggregations