If you're exporting files for machine consumption, please consider using something more robust than CSV.
Friends don't let friends export to CSV
261–270 of 459 posts
Re: Friends don't let friends export to CSV
#262This article seems written by someone who never had to work with diverse data pipelines. I work with large volumes of data from many different sources. I’m lucky to get them to send csv. Of course there are better formats, but all these sources aren’t able to agree on some successful format. Csv that’s zipped is producible and readable by everyone. And that makes is more efficient. I’ve been reading these “everyone i…
To me this criticism feels excessive. It feels like the author is describing their frustrations with internal usage of CSVs - there's no mention of customers and non-technical stakeholders at all. I think it goes without saying that Parquet files and other non-human-readable formats are a nonstarter when working with external stakeholders and the last paragraph makes that clear - if the end-user wants CSV, give them…
Parquet and Avro are widely supported in backend languages and also in data analysis. I don't think the article is talking about exported-like-a-jpeg, but instead exported-like-a-daily-report-run: the data scientist doing the exporting is probably using R or Pandas instead of Excel, and can reasonably be expected to read https://arrow.apache.org/docs/r/reference/read_parquet.html.
Re: Friends don't let friends export to CSV
#263- data that has predictable value types (mostly numbers and short labels would be fine), e.g. health data about a school class wouldn't involve random binary fields or unbounded user input
- data that has a predictable, managable length — e.g. the health data of the school class wouldn't be dramatically longer than the number of students in that class
- data with a long sampling period. If you read that dataset once a week performance and latency become utterly irrelevant
- if the shape of your data is already tabular and not e.g. a graph with many references to other rows
- if the gain in human readability and compatibility for the layperson outweighs potential downsides about the format
- if you use a sane default for encoding (utf8, what else), quoting, escaping, delimiter etc.
Every file format is a choice, often CSV isn't the wrong one (but: very often it is).
Re: Friends don't let friends export to CSV
#264Earlier quoted context omitted.
The problem is is that it is simple until it's not, then you have problems. You need to validate immediately after export, and work out what happens when that fails.
I agree about validating after export, which is a good practice. But if you know your use-case to be csv-friendly, then its a nice simple long-standing almost universal format. Lots of pros with that. Using a more complex format for simple data may (or may not) save you issues with a rare edge case but could cost you in other areas. Like a non-technical manager having no idea how to look at.
Re: Friends don't let friends export to CSV
#265Earlier quoted context omitted.
btw, xsv has solved most of my problems dealing with 'large' 40GB csv files
xsv? I never heard of it. This one? https://github.com/BurntSushi/xsv If yes, looks very cool. Plus, bonus HN/Internet points for being written in Rust!
Re: Friends don't let friends export to CSV
#266Re: Friends don't let friends export to CSV
#267Earlier quoted context omitted.
> Parsing CSV correctly is not hard, you just can’t use split and be done with it. Parsing RFC-compliant CSVs and telling clients to go away with non-compliant CSVs is not hard. Parsing real world CSVs reliably is simply impossible. The best you can do is heuristics. How do you interpret this row of CSV data? 1,5,The quotation mark "" is used...,2021-1-1 What is the third column? The RFC says that it should just be l…
For added fun, last column should be 1-2-2021.
Re: Friends don't let friends export to CSV
#268Earlier quoted context omitted.
In my experience, human readable file formats are a mistake. As soon as people can read a single file they think that that's the entire format and that it's okay to write it by hand or write their own code for it. And when everyone writes code based on the just what they've personally seen about a format, everyone is sad. This is why not a single piece of software on earth uses the CSV RFC. This is why people hand yo…
I think a takeaway could also be not to give people options when making a human-readable format. "you always need quotes, they're not optional" solves the comma problem. "the delimiter is always a comma" solves the delimiter problem. json has also fared better than csv, I'd say.
Re: Friends don't let friends export to CSV
#269Re: Friends don't let friends export to CSV
#270This article seems written by someone who never had to work with diverse data pipelines. I work with large volumes of data from many different sources. I’m lucky to get them to send csv. Of course there are better formats, but all these sources aren’t able to agree on some successful format. Csv that’s zipped is producible and readable by everyone. And that makes is more efficient. I’ve been reading these “everyone i…
It's the same with csv. They come in all kinds of formats because nobody agreed on the standard. Comma separated, semicolon separated, pipe separated, escaped, not escaped.
Everytime I have to deal with csv I first have to figure out how to parse it in code.
So I think the author is right, we must agree on a better format because that is what friends do.
You are also right because it's an illusion to think that this is going to change anythime soon. But who knows..