cinchapi / concourse

Distributed database warehouse for transactions, search and analytics across time.
http://concoursedb.com
Apache License 2.0
315 stars 235 forks source link

concourse-export does not properly escape double quotes within a field #499

Open jtnelson opened 4 months ago

jtnelson commented 4 months ago

In concourse-export, if a field contains spaces and double quotes, then the field is wrapped in single quotes. However, this does not conform to specification and causes issues when the data is reimported.

https://stackoverflow.com/questions/17808511/how-to-properly-escape-a-double-quote-in-csv

The fix should be to make sure that double quotes are escaped according to specification and also check the import framework to make sure that it properly handles what is expected.

The offending line is https://github.com/cinchapi/concourse/blob/87cf2370b41298f7da02c07389f2a3cbb3c7a502/concourse-export/src/main/java/com/cinchapi/concourse/export/DelimitedLinesExporter.java#L113

Perhaps use https://commons.apache.org/proper/commons-csv/ instead of building this ourselves?