PlanNode source = planRewriter.rewrite(node.getSource(), null);
if (source instanceof MaterializeSampleNode && Iterables.all(node.getExpressions(), DeterminismEvaluator.deterministic())) {
Symbol sampleWeightSymbol = ((MaterializeSampleNode) source).getSampleWeightSymbol();
Map<Symbol, Expression> outputMap = ImmutableMap.<Symbol, Expression>builder()
.putAll(node.getOutputMap())
.put(sampleWeightSymbol, new QualifiedNameReference(sampleWeightSymbol.toQualifiedName()))
.build();
ProjectNode projectNode = new ProjectNode(node.getId(), ((MaterializeSampleNode) source).getSource(), outputMap);
return new MaterializeSampleNode(source.getId(), projectNode, sampleWeightSymbol);
}
else {