DuckDB with IPFS CID's

David Gasquez February 22, 2023
Source
Thanks to fsspec, you can query arbitrary filesystems with DuckDB quite easily. To do so, you need to register a fsspec filesystem on DuckDB. Since IPFS has a supported fsspec plugin, ipfsspec, we can register it and start to query directly it with SQL. If you want to follow along, you'll need to install ipfsspec, duckdb and fsspec. You can do so with: Now, let's register the IPFS filesystem on DuckDB: Once the filesystem is registered, you can use CIDs as URIs inside readcsvauto or readparquet! The bafybeif5reawvqtsoybj5fhdl4ghaq3oc7kzepuws26zawkjm4johlv3uq CID is a CSV file. Querying it is as simple as: For Parquet files, you can do the same with readparquet: Voilà!

Discussion in the ATmosphere

Loading comments...