presto-main/src/main/java/io/prestosql/sql/planner/iterative/Memo.java/Memo/extract
class Memo:    private PlanNode extract(PlanNode node)
    {
        return resolveGroupReferences(node, Lookup.from(planNode -> Stream.of(this.resolve(planNode))));
    }