@Override
public PlanNode rewriteFilter(FilterNode node, Void context, PlanRewriter<Void> planRewriter)
{
PlanNode source = planRewriter.rewrite(node.getSource(), null);
if (source instanceof MaterializeSampleNode && DeterminismEvaluator.isDeterministic(node.getPredicate())) {
FilterNode filterNode = new FilterNode(node.getId(), ((MaterializeSampleNode) source).getSource(), node.getPredicate());
return new MaterializeSampleNode(source.getId(), filterNode, ((MaterializeSampleNode) source).getSampleWeightSymbol());
}
else {
return planRewriter.defaultRewrite(node, null);
}