I just don't understand how these guys could literally give terrabytes of free storage and free data transfer to everyone. I was doing some calculation of cost from my storage and transfers and if they used something like S3 it would costed them 1000s of dollar. And I don't pay them anything.
Improving Parquet Dedupe on Hugging Face Hub
11–18 of 18 posts
Re: Improving Parquet Dedupe on Hugging Face Hub
#12How does this compare to rsync/rdiff?
Great question! Rsync also uses a rolling hash/content defined chunking approach to deduplicate and reduce communication. So it will behave very similarly.
Re: Improving Parquet Dedupe on Hugging Face Hub
#13I'm not really familiar of how datasets are managed by them, but all of the table formats (iceberg, delta and hudi) support appending and some form of "merge-on-read" deletes that could help with this use case. Instead of always fully replacing datasets on each dump, more granular operations could be done. The issue is that this requires changing pipelines and some extra knowledge about the datasets itself. A fun idea might involve taking a table format like iceberg, and instead of using parquet to store the data, just store the column data with the metadata externally defined somewhere else. On each new snapshot, a set of transformations (sorting, spiting blocks, etc) could be applied that minimizes that the potential byte diff between the previous snapshot.
Re: Improving Parquet Dedupe on Hugging Face Hub
#14Earlier quoted context omitted.
Great question! Rsync also uses a rolling hash/content defined chunking approach to deduplicate and reduce communication. So it will behave very similarly.
One more: do you prefer the CDC technique over using the rowgroups as chunks (ie using knowledge of the file structure)? Is it worth it to build a parquet-specific diff?
Re: Improving Parquet Dedupe on Hugging Face Hub
#15I just don't understand how these guys could literally give terrabytes of free storage and free data transfer to everyone. I was doing some calculation of cost from my storage and transfers and if they used something like S3 it would costed them 1000s of dollar. And I don't pay them anything.
Re: Improving Parquet Dedupe on Hugging Face Hub
#16I'm surprised that Parquet didn't maintain the Arrow practice of using mmap-able relative offsets for everything. Although these could be called relative to the beginning of the file.
Arrow is designed for zero copy ipc -- it is, by definition, an in-memory format that is therefore mmappable.
Parquet is an on-disk format, designed to be space efficient.
So for example, Parquet supports general purpose compression in addition to dictionary and RLE encodings. General purpose compression forces you to make copies, but if you're streaming from disk the extra cost of decompressing blocks is acceptable.
Arrow doesn't use general purpose compression because it would force copies to be made and dominate compute costs for data in memory.
Re: Improving Parquet Dedupe on Hugging Face Hub
#17If the sharding key matches (or is a subset of) a join or group-by key, then identical values are local to a single shard, which can be processed independently.
This type of thing is typically done at large granularity (eg one shard per MPP compute node), but there are also benefits down to the core or thread level.
Another tip is that if no shard key is defined, hash the whole row as a default.
Re: Improving Parquet Dedupe on Hugging Face Hub
#18One additional thought regarding query performance is that content-defined row groups allow localized joins and aggregations which are much faster than the globally-shuffled kind. If the sharding key matches (or is a subset of) a join or group-by key, then identical values are local to a single shard, which can be processed independently. This type of thing is typically done at large granularity (eg one shard per MPP…