When uploading CSV files to CartoDB through their web interface, all columns default to string as their data type, despite the CSV file containing a number of number-only columns. An example row is
1400000US55025000100,55025000100,"Census Tract 1, Dane County, Wisconsin",1401,118,1070,128,903,136,167,82,131,62,36,34,0,9,179,74,179,74,0,9,0,9,0,9,0,9,36,31,35,28,6,11,75,45
I know I can change the data type in the table editor, but when you have a large number of columns, this becomes very tedious. According to their documentation, CartoDB should automatically assigns the right data type. Any advice on how to make this work?
1 Answer 1
CSV does not have the concept of data types and that's why CartoDB tries to guess the type of the column. In any case CartoDB can not have a 100% success rate.
if you want to ensure your data types are kept use a format that allow data types (geojson, shp for example)
In this case I think it's a problem with ogr2ogr (the tool we use under the hood to process files). I reported this as a bug https://github.com/CartoDB/cartodb/issues/2600 so you can track it
-
Thanks! I'll follow your bug report on GitHub and for now just change the data types manually/with SQL.vgXhc– vgXhc2015年03月05日 16:00:30 +00:00Commented Mar 5, 2015 at 16:00