code: func ColumnSubstitute(expr Expression, schema *Schema, newExprs []Expression) Expression {
  	switch v := expr.(type) {
  	case *Column:
  		id := schema.ColumnIndex(v)
  		if id == -1 {
  			return v
  		}
  		newExpr := newExprs[id]
  		if v.InOperand {
  			newExpr = setExprColumnInOperand(newExpr)
  		}
  		return newExpr
  	case *ScalarFunction:
  		if v.FuncName.L == ast.Cast {
  			newFunc := v.Clone().(*ScalarFunction)
  			newFunc.GetArgs()[0] = ColumnSubstitute(newFunc.GetArgs()[0], schema, newExprs)
  			return newFunc
  		}
  		newArgs := make([]Expression, 0, len(v.GetArgs()))
  		for _, arg := range v.GetArgs() {
  			newArgs = append(newArgs, ColumnSubstitute(arg, schema, newExprs))
  		}
  		return NewFunctionInternal(v.GetCtx(), v.FuncName.L, v.RetType, newArgs...)
  	}
  	return expr
  }
docs: // ColumnSubstitute substitutes the columns in filter to expressions in select fields.
  // e.g. select * from (select b as a from t) k where a < 10 => select * from (select b as a from t where b < 10) k.