code: protected PlanNode attachDuplicateRemoval( QueryContext context,
                                                 PlanNode plan ) {
          PlanNode dupNode = new PlanNode(Type.DUP_REMOVE);
          plan.setParent(dupNode);
          return dupNode;
      }
docs: Attach DUP_REMOVE node at top of tree. The DUP_REMOVE may be pushed down to a source (or sources) if possible by the
  optimizer.
  
  @param context the context in which the query is being planned
  @param plan the existing plan
  @return the updated plan