Query Parquet files in SQLite
cldellow.com
cldellow.com
I also like how it combines a "big data" format (parquet) with the main "your data isn't actually big data" tool of choice (sqlite).
If you are considering only file sizes then i would recommend this zipping method. If you are more interested in query time capabilities/advantages then you must consider Parquet.
We are still experimenting with Parquet because our dataset keeps increasing by about 100GB everyday.
I'm skeptical it would be as good as the parquet/sqlite option the author came up with (postgres I believe does compression value-by-value, can't remember how MySQL does it).
Its sweet spot is for much larger rows. In fact, it only kicks in for rows whose content is larger than the page size (2KB or so), so it doesn't trigger for this case, where the average row size is about 120 bytes (and only 80 bytes of that is content).
I bet you could build the DB, stop Postgres, move its data dir to a squashfs filesystem, and then start Postgres in read-only mode for a huge space savings with minimal query cost, though.
Hmm, in fact, it'd be easy to do that with the SQLite DB since it's just a single file. I might give that a shot.
I added a section at https://cldellow.com/2018/06/22/sqlite-parquet-vtable.html#s... to mention it. Thanks for the inspiration!
It reads like row level compression + index compression? They claim indexes make up a fair chunk of the disk usage, so there may be advantages.
MariaDB has the Connect Engine, Postgres has Foreign Data Wrappers (fdw), define an openrowset for mssql using an odbc or ole driver and config. DB2 and informix have federated options.
The author has missed a lot of detail about the breadth of options the FDW for csv provides. Just like a normal table you should define column names and ideally their types so you don’t have just ordinal/generates column names (if there is no header line), which the author does anyway for SQLite. The same problem of denormalisation exists, in which case, data scrubbing cannot be avoided; yet more serialisation eating precious cycles and memory.
My point is, read the manual for your database, it might surprise you as to what it can already do, and how much time it can save you.
I think you may have missed the point of the article. This is essentially an FDW for SQLite so that it can read Parquet files, because CSVs are space inefficient.
The "You're almost certainly going to regret your life." in the README.md goes along with that. ;)
How hard was it to get up and running for your Ubuntu 16.04 system?
Asking because we (sqlitebrowser.org) have started moving our Win installer to be MSI based, and are considering having useful SQLite extensions being added to the mix.
https://github.com/sqlitebrowser/sqlitebrowser/issues/1401#i...
Thoughts? :)
I may be overstating the difficulty of building it for Linux. I hadn't written C++ code in ages prior to starting this, so I'm sure I was tripping over things that others would sail past. I was also simultaneously trying to build a version of pyarrow that supported some bleeding edge features. However, I _definitely_ had an incorrect mental model of where the libraries were getting installed, which led to some wasted time and frustration.
With time and some emotional distance, I'd like to take a stab at cleaning up the Linux build so that it can hook into travis-ci and codecov.
I think once that happened, getting the OS X build to work shouldn't be too difficult. I don't have an OS X machine, though, so I'm not in a great position to test that.
As for Windows... if I know very little about building C++ code the right way in Linux, I know nothing for Windows :( I do have a Windows machine, so I'm sure with enough goading I could be convinced to take a look at it. Feel free to open issues for an OS X and/or Windows build, although I can't guarantee a timely resolution to either of them!
Like, arguably too large to efficiently work with as a single plaint text file, but not quite so large to warrant, you know, tooling.