DrillRel inputRel = projectRel != null ? projectRel : scanRel;
PlannerSettings settings = PrelUtil.getPlannerSettings(call.getPlanner());
DirPathBuilder builder = new DirPathBuilder(filterRel, inputRel, filterRel.getCluster().getRexBuilder(), new FileSystemPartitionDescriptor(settings.getFsPartitionColumnLabel()));
FormatSelection origSelection = (FormatSelection)scanRel.getDrillTable().getSelection();
FormatSelection newSelection = splitFilter(origSelection, builder);
if (origSelection == newSelection) {
return; // no directory filter was pushed down
}
try {
FileGroupScan fgscan = ((FileGroupScan)scanRel.getGroupScan()).clone(newSelection.getSelection());
PartitionPruningUtil.rewritePlan(call, filterRel, projectRel, scanRel, fgscan, builder);
} catch (IOException e) {
throw new DrillRuntimeException(e) ;
}
}