jpillora / csv-to-influxdb

Import CSV files into InfluxDB
80 stars 37 forks source link

add option to insert numeric values as strings #7

Closed pouyatafti closed 7 years ago

pouyatafti commented 7 years ago

Since fields are scanned for types on a row-by-row basis, it can happen that a string value is mistaken for a numeric (e.g. with values such as '1234', '123x', ...). This creates a problem as inserting values of different types is not supported. This option would simply insert all fields as strings, with the exception of timestamps.

A better solution might have been to have the possibility to specify the column types, or to infer them based on a subset of the CSV, rather than independently for each row. But implementing these would involve more effort.

jpillora commented 7 years ago

Thanks, yep I think column types is a good though indeed - much more effort