code: func extractCorColumnsBySchema(p LogicalPlan, schema *expression.Schema) []*expression.CorrelatedColumn {
  	corCols := p.extractCorrelatedCols()
  	resultCorCols := make([]*expression.CorrelatedColumn, schema.Len())
  	for _, corCol := range corCols {
  		idx := schema.ColumnIndex(&corCol.Column)
  		if idx != -1 {
  			if resultCorCols[idx] == nil {
  				resultCorCols[idx] = &expression.CorrelatedColumn{
  					Column: *schema.Columns[idx],
  					Data:   new(types.Datum),
  				}
  			}
  			corCol.Data = resultCorCols[idx].Data
  		}
  	}
  	// Shrink slice. e.g. [col1, nil, col2, nil] will be changed to [col1, col2].
  	length := 0
  	for _, col := range resultCorCols {
  		if col != nil {
  			resultCorCols[length] = col
  			length++
  		}
  	}
  	return resultCorCols[:length]
  }
docs: // extractCorColumnsBySchema only extracts the correlated columns that match the specified schema.
  // e.g. If the correlated columns from plan are [t1.a, t2.a, t3.a] and specified schema is [t2.a, t2.b, t2.c],
  // only [t2.a] is returned.