docs: protected static void rewriteInSubqueryAsExists(
              ParsedSelectStmt selectStmt, AbstractExpression inListExpr) {
          List<AbstractExpression> whereList = new ArrayList<>();
          List<AbstractExpression> havingList = new ArrayList<>();
  
          // multi-column IN expression is a RowSubqueryExpression
          // where each arg represents an individual column
          List<AbstractExpression> inExprList = null;
          if (inListExpr instanceof RowSubqueryExpression) {
              inExprList = inListExpr.getArgs();
          }
          else {
              inExprList = new ArrayList<>();
              inExprList.add(inListExpr);
          }
          int idx = 0;
          assert(inExprList.size() == selectStmt.m_displayColumns.size());
          selectStmt.m_aggregationList = new ArrayList<>();
  
          // Iterate over the columns from the IN list
          // and the subquery output schema
          // For each pair create a new equality expression.
          // If the output column is part of the aggregate expression, the
          // new expression must be added to the subquery's HAVING expressions.
          // If not, it should be added to the WHERE expressions
          for (AbstractExpression expr : inExprList) {
              ParsedColInfo colInfo = selectStmt.m_displayColumns.get(idx++);
              assert(colInfo.m_expression != null);
              // The TVE and the aggregated expressions from the IN clause will
              // be parameters to the child select statement once the IN
              // expression is replaced with the EXISTS one.
              expr = selectStmt.replaceExpressionsWithPve(expr);
              // Finalize the expression. The subquery's own expressions
              // are already finalized but not the expressions from the IN list
              ExpressionUtil.finalizeValueTypes(expr);
  
              // Create new compare equal expression
              AbstractExpression equalityExpr =
                      new ComparisonExpression(ExpressionType.COMPARE_EQUAL,
                              expr, colInfo.m_expression.clone());
              // Check if this column contains aggregate expression
              if (ExpressionUtil.containsAggregateExpression(colInfo.m_expression)) {
                  // We are not creating any new aggregate expressions so
                  // the aggregation list doen't need to be updated.
                  // Only the HAVING expression itself
                  havingList.add(equalityExpr);
              }
              else {
                  whereList.add(equalityExpr);
              }
          }
          // Add new WHERE expressions
          if ( ! whereList.isEmpty()) {
              if (selectStmt.m_joinTree.getWhereExpression() != null) {
                  whereList.add(selectStmt.m_joinTree.getWhereExpression());
              }
              selectStmt.m_joinTree.setWhereExpression(
                      ExpressionUtil.combinePredicates(whereList));
          }
          // Add new HAVING expressions
          if (!havingList.isEmpty()) {
              if (selectStmt.m_having != null) {
                  havingList.add(selectStmt.m_having);
              }
              selectStmt.m_having = ExpressionUtil.combinePredicates(havingList);
              // reprocess HAVING expressions
              ExpressionUtil.finalizeValueTypes(selectStmt.m_having);
          }
  
          selectStmt.m_aggregationList = null;
  
          if (selectStmt.needComplexAggregation()) {
              selectStmt.fillUpAggResultColumns();
          }
          else {
              selectStmt.m_aggResultColumns = selectStmt.m_displayColumns;
          }
          selectStmt.placeTVEsinColumns();
      }