private PColFilterExtractor test(org.apache.pig.impl.logicalLayer.LogicalPlan lp, List<String> partitionCols,
String expPartFilterString, String expFilterString)
throws IOException {
LogicalPlan newLogicalPlan = migratePlan( lp );
LOFilter filter = (LOFilter)newLogicalPlan.getSinks().get(0);
PColFilterExtractor pColExtractor = new PColFilterExtractor(
filter.getFilterPlan(), partitionCols);
pColExtractor.visit();
if(expPartFilterString == null) {
Assert.assertEquals("Checking partition column filter:", null,
pColExtractor.getPColCondition());
} else {
Assert.assertEquals("Checking partition column filter:",
expPartFilterString.toLowerCase(),
pColExtractor.getPColCondition().toString().toLowerCase());
}
if(expFilterString == null) {
Assert.assertTrue("Check that filter can be removed:",
pColExtractor.isFilterRemovable());
} else {
String actual = PColFilterExtractor.getExpression(
(LogicalExpression)filter.getFilterPlan().getSources().get(0)).
toString().toLowerCase();
Assert.assertEquals("checking trimmed filter expression:", expFilterString,