code: func CastValues(ctx context.Context, rec []types.Datum, cols []*Column, ignoreErr bool) (err error) {
  	for _, c := range cols {
  		var converted types.Datum
  		converted, err = CastValue(ctx, rec[c.Offset], c.ToInfo())
  		if err != nil {
  			if ignoreErr {
  				log.Printf("cast values failed:%v", err)
  			} else {
  				return errors.Trace(err)
  			}
  		}
  		rec[c.Offset] = converted
  	}
  	return nil
  }
docs: // CastValues casts values based on columns type.