3 ms·
Here are the main advantages of Parquet over CSV (post author made these points more abstractly): * Parquet stores schema in the metadata, so schema inference
by MrPowers 5y ago
Here are the main advantages of Parquet over CSV (post author made these points more abstractly):
* Parquet stores schema in the metadata, so schema inference isn't required (schema inference is expensive for big datasets)
* Parquet files are columnar so individual columns can be grabbed for analyses (Spark does this automatically). This is a huge performance improvement.
* Row groups contain min/max info for each column, which allows for predicate pushdown filtering data skipping. Highly recommend playing with PyArrow + Parquet to see the metadata that's available.
* Columnar file formats are easier to compress. Binary files are way smaller than text files like CSV even without compression.
I wrote a blog post that shows how a Parquet query that leverages column pruning and predicate pushdown filtering can be 85x faster than an equivalent CSV query: https://coiled.io/parquet-column-pruning-predicate-pushdown/ https://coiled.io/parquet-column-pruning-predicate-pushdown/
CSVs are great for small datasets when human readability is an important feature. They're also great when you need to mutate the file. Parquet files are immutable.
It's easy to convert CSVs => Parquet/Delta/Avro with Pandas/Dask/Spark.
The world is already shifting to different file formats. We just need to show folks how Parquet is easy to use and will greatly increase their analysis speeds & they'll be happy to start using it.
Small nit: the article implies Apache Arrow is a file format. It's a memory format.