File partition3;
@Test
public void testListStatusPartitionFilterNotFound() throws Exception {
PathPartitionHelper partitionHelper = new PathPartitionHelper();
Job job = new Job(conf);
job.setJobName("TestJob");
job.setInputFormatClass(FileInputFormat.class);
Configuration conf = job.getConfiguration();
FileInputFormat.setInputPaths(job, new Path(baseDir.getAbsolutePath()));
Iterator<Map.Entry<String, String>> iter = conf.iterator();
while (iter.hasNext()) {
Map.Entry<String, String> entry = iter.next();
System.out.println(entry.getKey() + ": " + entry.getValue());
}
JobContext jobContext = HadoopShims.createJobContext(conf, job.getJobID());
partitionHelper.setPartitionFilterExpression("year < '2010'",
PigStorage.class, "1");
partitionHelper.setPartitionKeys(baseDir.getAbsolutePath(), conf,
PigStorage.class, "1");
List<FileStatus> files = partitionHelper.listStatus(jobContext,
PigStorage.class, "1");
assertEquals(0, files.size());
}