move math calculation in `map_csv` into mysql