docs: public void analyzeForMultiPartitionAccess(Collection<StmtTableScan> scans,
              HashMap<AbstractExpression, Set<AbstractExpression>> valueEquivalence) {
          //* enable to debug */ System.out.println("DEBUG: analyze4MPAccess w/ scans:" + scans.size() + " filters:" + valueEquivalence.size());
          TupleValueExpression tokenPartitionKey = null;
          Set< Set<AbstractExpression> > eqSets = new HashSet< >();
          int unfilteredPartitionKeyCount = 0;
  
          // reset this flag to forget the last result of the multiple partition access path.
          // AdHoc with parameters will call this function at least two times
          // By default this flag should be true.
          setJoinValid(true);
          setJoinInvalidReason(null);
          boolean subqueryHasReceiveNode = false;
          boolean hasPartitionedTableJoin = false;
          // Iterate over the tables to collect partition columns.
          for (StmtTableScan tableScan : scans) {
              // Replicated tables don't need filter coverage.
              if (tableScan.getIsReplicated()) {
                  continue;
              }
  
              // The partition column can be null in an obscure edge case.
              // The table is declared non-replicated yet specifies no partitioning column.
              // This can occur legitimately when views based on partitioned tables neglect to group by the partition column.
              // The interpretation of this edge case is that the table has "randomly distributed data".
              // In such a case, the table is valid for use by MP queries only and can only be joined with replicated tables
              // because it has no recognized partitioning join key.
              List<SchemaColumn> columnsNeedingCoverage = tableScan.getPartitioningColumns();
  
              if (tableScan instanceof StmtSubqueryScan) {
                  StmtSubqueryScan subScan = (StmtSubqueryScan) tableScan;
                  subScan.promoteSinglePartitionInfo(valueEquivalence, eqSets);
                  CompiledPlan subqueryPlan = subScan.getBestCostPlan();
                  if (( ! subScan.canRunInOneFragment()) ||
                          ((subqueryPlan != null) &&
                           subqueryPlan.rootPlanGraph.hasAnyNodeOfClass(AbstractReceivePlanNode.class))) {
                      if (subqueryHasReceiveNode) {
                          // Has found another subquery with receive node on the same level
                          // Not going to support this kind of subquery join with 2 fragment plan.
                          setJoinValid(false);
                          setJoinInvalidReason("This multipartition query is not plannable.  "
                                               + "It has a subquery which cannot be single partition.");
                          // Still needs to count the independent partition tables
                          break;
                      }
                      subqueryHasReceiveNode = true;
  
                      if (subScan.isTableAggregate()) {
                          // Partition Table Aggregate only return one aggregate row.
                          // It has been marked with receive node, any join or processing based on
                          // this table aggregate subquery should be done on coordinator.
                          // Joins: has to be replicated table
                          // Any process based on this subquery should require 1 fragment only.
                          continue;
                      }
                  } else {
                      // this subquery partition table without receive node
                      hasPartitionedTableJoin = true;
                  }
              } else {
                  // This table is a partition table
                  hasPartitionedTableJoin = true;
              }
  
              boolean unfiltered = true;
              for (AbstractExpression candidateColumn : valueEquivalence.keySet()) {
                  if ( ! (candidateColumn instanceof TupleValueExpression)) {
                      continue;
                  }
                  TupleValueExpression candidatePartitionKey = (TupleValueExpression) candidateColumn;
                  if (! canCoverPartitioningColumn(candidatePartitionKey, columnsNeedingCoverage)) {
                      continue;
                  }
                  unfiltered = false;
                  if (tokenPartitionKey == null) {
                      tokenPartitionKey = candidatePartitionKey;
                  }
                  eqSets.add(valueEquivalence.get(candidatePartitionKey));
              }
  
              if (unfiltered) {
                  ++unfilteredPartitionKeyCount;
              }
          } // end for each table StmtTableScan in the collection
  
          m_countOfIndependentlyPartitionedTables = eqSets.size() + unfilteredPartitionKeyCount;
          //* enable to debug */ System.out.println("DEBUG: analyze4MPAccess found: " + m_countOfIndependentlyPartitionedTables + " = " + eqSets.size() + " + " + unfilteredPartitionKeyCount);
          if (m_countOfIndependentlyPartitionedTables > 1) {
              setJoinValid(false);
              setJoinInvalidReason("This query is not plannable.  "
                                   + "The planner cannot guarantee that all rows would be in a single partition.");
          }
  
          // This is the case that subquery with receive node join with another partition table
          // on outer level. Not going to support this kind of join.
          if (subqueryHasReceiveNode && hasPartitionedTableJoin) {
              setJoinValid(false);
              setJoinInvalidReason("This query is not plannable.  It has a subquery which needs cross-partition access.");
          }
  
          if ((unfilteredPartitionKeyCount == 0) && (eqSets.size() == 1)) {
              for (Set<AbstractExpression> partitioningValues : eqSets) {
                  for (AbstractExpression constExpr : partitioningValues) {
                      if (constExpr instanceof TupleValueExpression) {
                          continue;
                      }
                      VoltType valueType = tokenPartitionKey.getValueType();
                      addPartitioningExpression(tokenPartitionKey.getTableName() +
                              '.' + tokenPartitionKey.getColumnName(), constExpr, valueType);
                      // Only need one constant value.
                      break;
                  }
              }
          } else if (scans.size() == 1) {
              // ENG-15117
              // For query like "select * from (select DL_REGISTER_IP_CITY  from SJYH_DENGLU2 where DL_USER_ID = '113001' ) as result;"
              // There is no filter on the outer query,
              // the inferredParameterIndex should be inferred from the subquery instead of uninitialized (-1).
              StmtTableScan tableScan = scans.iterator().next();
              if (tableScan instanceof StmtSubqueryScan) {
                  StmtSubqueryScan subScan = (StmtSubqueryScan) tableScan;
                  m_inferredParameterIndex = subScan.getScanPartitioning().getInferredParameterIndex();
              }
          }
      }