docs: private void connectNodesIfNecessary(AbstractPlanNode node) {
          NodeSchema outputSchema = node.getOutputSchema();
          if (outputSchema != null) {
              for (SchemaColumn col : outputSchema) {
                  connectPredicateStmt(col.getExpression());
              }
          }
          if (node instanceof AbstractScanPlanNode) {
              AbstractScanPlanNode scanNode = (AbstractScanPlanNode)node;
              connectPredicateStmt(scanNode.getPredicate());
              // If this is common table scan, we connect the scan node to the
              // plan nodes for the base and recursive query.
              if (scanNode instanceof SeqScanPlanNode) {
                  SeqScanPlanNode seqScanNode = (SeqScanPlanNode)scanNode;
                  connectCTENodesIfAny(seqScanNode);
              }
          } else if (node instanceof AbstractJoinPlanNode) {
              AbstractJoinPlanNode joinNode = (AbstractJoinPlanNode)node;
              connectPredicateStmt(joinNode.getPreJoinPredicate());
              connectPredicateStmt(joinNode.getJoinPredicate());
              connectPredicateStmt(joinNode.getWherePredicate());
          } else if (node instanceof AggregatePlanNode) {
              AggregatePlanNode aggNode = (AggregatePlanNode)node;
              connectPredicateStmt(aggNode.getPostPredicate());
          }
  
          for (AbstractPlanNode inlineNode: node.getInlinePlanNodes().values()) {
              connectNodesIfNecessary(inlineNode);
          }
      }