Using ClickHouse you can also process local files in one line using clickhouse-local command tool. And it will look a lot easier: clickhouse local -q "SELECT passenger_count, COUNT(*), AVG(total_amount) FROM file(taxi.csv, 'CSVWithNames') GROUP BY passenger_count" And ClickHouse supports a lot of different file formats both for import and export (you can see all of them here https://clickhouse.com/docs/en/interfaces/…
Clickhouse-local is incredible. It does the best of any similar tool I've benchmarked. But the reason I took it out of the linked benchmarks in OP's post is because it's 2+GB. That's a massive binary. It's the whole server. I'm not sure you want to be distributing this all over the place in general. It's just not in the same category IMO. Disclaimer: I build another tool that does similar things.
One-liner for running queries against CSV files with SQLite
81–90 of 131 posts
Re: One-liner for running queries against CSV files with SQLite
#82Using ClickHouse you can also process local files in one line using clickhouse-local command tool. And it will look a lot easier: clickhouse local -q "SELECT passenger_count, COUNT(*), AVG(total_amount) FROM file(taxi.csv, 'CSVWithNames') GROUP BY passenger_count" And ClickHouse supports a lot of different file formats both for import and export (you can see all of them here https://clickhouse.com/docs/en/interfaces/…
Clickhouse-local is incredible. It does the best of any similar tool I've benchmarked. But the reason I took it out of the linked benchmarks in OP's post is because it's 2+GB. That's a massive binary. It's the whole server. I'm not sure you want to be distributing this all over the place in general. It's just not in the same category IMO. Disclaimer: I build another tool that does similar things.
Without debug info, it will be 350 MB, and compressed can fit in 50 MB: https://github.com/ClickHouse/ClickHouse/issues/29378
It is definitely a worth improvement.
Re: One-liner for running queries against CSV files with SQLite
#83One of my all-time favorite (and somehow still-obscure / relatively unknown) tools is called `lnav` ^1. It's a mini-ETL powertool with embedded SQLite, perfect for wrangling log files or other semi-structured data (a few millions of rows are no problem), it's intuitive and flexible... 1. https://lnav.org
of course because it has a flexible format definition it can deal with csv files as well, but it's true power is getting sql queries out of nginx log files and the like without the intermediate step of exporting them to csv.
Re: One-liner for running queries against CSV files with SQLite
#84How smart is SQLite at detecting column types from Csv data? I once wrote a Python script to load csv files into SQLite. It had a whole hierarchy of rules to determine the data type of each column.
Re: One-liner for running queries against CSV files with SQLite
#85Since many people are sharing one-liners with various tools... OctoSQL[0]: octosql 'SELECT passenger_count, COUNT(*), AVG(total_amount) FROM taxi.csv GROUP BY passenger_count' It also infers everything automatically and typechecks your query for errors. You can use it with csv, json, parquet but also Postgres, MySQL, etc. All in a single query! [0]: https://github.com/cube2222/octosql Disclaimer: author of OctoSQL
Heads up: cube2222 is the original author of this benchmark. :) I copied it and Simon copied my copy of it.
Though btw., I think I personally prefer the SPyQL benchmarks[0], as they test a bigger variety of scenarios. This benchmark is mostly testing CSV decoding speed - because the group by is very simple, with just a few keys in the grouping.
[0]:https://colab.research.google.com/github/dcmoura/spyql/blob/...
Re: One-liner for running queries against CSV files with SQLite
#86I am a data scientists. I have used a lot of tools/libraries to interact with data. SQLite is my favorite. It is hard to beat the syntax/grammar. Also, when I use SQLite I do not output using column mode. I pipe to `tv` (tidy-viewer) to get a pretty output. https://github.com/alexhallam/tv transparency: I am the dev of this utility
piping to jq (using json mode of course) also works well for this
Re: One-liner for running queries against CSV files with SQLite
#87Re: One-liner for running queries against CSV files with SQLite
#88Re: One-liner for running queries against CSV files with SQLite
#89Earlier quoted context omitted.
Heads up: cube2222 is the original author of this benchmark. :) I copied it and Simon copied my copy of it.
Thanks for the acknowledgement! Though btw., I think I personally prefer the SPyQL benchmarks[0], as they test a bigger variety of scenarios. This benchmark is mostly testing CSV decoding speed - because the group by is very simple, with just a few keys in the grouping. [0]: https://colab.research.google.com/github/dcmoura/spyql/blob/...
That doesn't change the poor performance of dsq but it does change the relative and absolute scores in that benchmark.