docs: private boolean rewriteSelectStmt() {
          if (m_mvi != null) {
              final Table view = m_mvi.getDest();
              final String viewName = view.getTypeName();
              // Get the map of select stmt's display column index -> view table (column name, column index)
              m_selectStmt.getFinalProjectionSchema()
                      .resetTableName(viewName, viewName)
                      .toTVEAndFixColumns(m_QueryColumnNameAndIndx_to_MVColumnNameAndIndx.entrySet().stream()
                              .collect(Collectors.toMap(kv -> kv.getKey().getFirst(), Map.Entry::getValue)));
              // change to display column index-keyed map
              final Map<Integer, Pair<String, Integer>> colSubIndx = m_QueryColumnNameAndIndx_to_MVColumnNameAndIndx
                      .entrySet().stream().collect(Collectors.toMap(kv -> kv.getKey().getSecond(), Map.Entry::getValue));
              ParsedSelectStmt.updateTableNames(m_selectStmt.m_aggResultColumns, viewName);
              ParsedSelectStmt.fixColumns(m_selectStmt.m_aggResultColumns, colSubIndx);
              ParsedSelectStmt.updateTableNames(m_selectStmt.m_displayColumns, viewName);
              ParsedSelectStmt.fixColumns(m_selectStmt.m_displayColumns, colSubIndx);
              m_selectStmt.rewriteAsMV(view);
              m_mvi = null; // makes this method re-entrant safe
              return true;
          } else {      // scans all sub-queries for rewriting opportunities
              return m_selectStmt.allScans().stream()
                      .map(scan -> scan instanceof StmtSubqueryScan && rewriteTableAlias((StmtSubqueryScan) scan))
                      .reduce(Boolean::logicalOr).get();
          }
      }