This is the description in the experimental PR (parallel CSV has since merged into the main branch)
The problem is perhaps most obvious when you consider that the value of a single cell could itself be a CSV, and this could be recursive
An unescaped cell within a CSV will break most CSV parsers in the world even with recursion handling.
CSVs are a bit of a mess. Non-trivial to parse properly, due to escaping, and the standard (such as it is) is poorly followed. E.g. sometimes people use semi-colon or pipe instead of comma.
See also: 'Why isn’t there a decent file format for tabular data?' https://news.ycombinator.com/item?id=31220841
This is also my use case where I have GBs of data in S3 as Parquet and a small CSV file that I have to join them to.
And DuckDB reads CSVs and Parquet and SQLite and others. I can join all these heterogeneous data types in a single SQL statement and have the assurance that it’ll be done correctly.
I believe clickhouse-local can do the same.
https://pandas.pydata.org/docs/reference/api/pandas.read_csv...
Parsing a CSV by hand is almost always the wrong thing to do unless you also wrote the CSV generating process and can limit the variance.
But if not, instead of working with CSVs at the string level and risk running into issues, I've found that the best practice is to farm the CSV parsing out to a battle-tested engine (I use DuckDB, but sqlite, pandas, polars, clickhouse-local or any number of engines work), and work with the parsed object instead.
Better yet, avoid CSV and use DuckDB + Parquet (paired with visidata for quick vizes) for anything nontrivial.
perl -MText::CSV=csv -e'my $aoh = csv(in=>"foo.csv",headers=>"auto",keep_headers=>\my @h); @$aoh = grep { $_->{some_header} > 0 } @$aoh; csv(in=>$aoh,out=>*STDOUT,headers=>\@h)'