@Override
public PlanNode rewriteSort(SortNode node, Void context, PlanRewriter<Void> planRewriter)
{
PlanNode source = planRewriter.rewrite(node.getSource(), null);
if (source instanceof MaterializeSampleNode) {
node = new SortNode(node.getId(), ((MaterializeSampleNode) source).getSource(), node.getOrderBy(), node.getOrderings());
return new MaterializeSampleNode(source.getId(), node, ((MaterializeSampleNode) source).getSampleWeightSymbol());
}
else {
return planRewriter.defaultRewrite(node, null);
}