We still need the output symbols of the distinct limit operator to be retained. I will change it to 
PlanNode source = planRewriter.rewrite(node.getSource(), ImmutableSet.copyOf(node.getOutputSymbols())); 

so that all other symbols are pruned