presto-main/src/main/java/io/prestosql/sql/planner/iterative/rule/PruneCrossJoinColumns.java/PruneCrossJoinColumns/pushDownProjectOff
class PruneCrossJoinColumns:    @Override
    protected Optional<PlanNode> pushDownProjectOff(PlanNodeIdAllocator idAllocator, JoinNode joinNode, Set<Symbol> referencedOutputs)
    {
        Optional<PlanNode> newLeft = restrictOutputs(idAllocator, joinNode.getLeft(), referencedOutputs);
        Optional<PlanNode> newRight = restrictOutputs(idAllocator, joinNode.getRight(), referencedOutputs);

        if (!newLeft.isPresent() && !newRight.isPresent()) {
            return Optional.empty();
        }

        ImmutableList.Builder<Symbol> outputSymbolBuilder = ImmutableList.builder();
        outputSymbolBuilder.addAll(newLeft.orElse(joinNode.getLeft()).getOutputSymbols());
        outputSymbolBuilder.addAll(newRight.orElse(joinNode.getRight()).getOutputSymbols());

        return Optional.of(new JoinNode(
                idAllocator.getNextId(),
                joinNode.getType(),
                newLeft.orElse(joinNode.getLeft()),
                newRight.orElse(joinNode.getRight()),
                joinNode.getCriteria(),
                outputSymbolBuilder.build(),
                joinNode.getFilter(),
                joinNode.getLeftHashSymbol(),
                joinNode.getRightHashSymbol(),
                joinNode.getDistributionType(),
                joinNode.isSpillable(),
                joinNode.getDynamicFilters()));
    }