Since 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
Just today I tried octosql for the first time when I wanted to correlate a handful of CSV files based on identifiers present in roughly equal form. Great idea but I immediately ran into many rough edges in what I think was a simple use case. Here are my random observations.
Missing FULL JOIN (this was a dealbreaker for me). LEFT/RIGHT join gave me "panic: implement me".
It took me a while to figure out how to quote CSV column names with non-ASCII characters and spaces. It's not documented as far as I've seen (please document quoting rules). This worked:
octosql 'SELECT `tablename.Mötley Crüe` FROM tablename.csv'
replace() is documented [1] as replace(old, new, text) but actually is replace(text, old, new) just like in postgres and mysql.index() is documented [1] as index(substring, text)
(postgresql equivalent: position ( substring text IN string text ) → integer)
octosql "SELECT index('y', 'Mötley Crüe')"
Error: couldn't parse query: invalid argument syntax error at position 13 near 'index'
octosql "SELECT index('Mötley Crüe', 'y')"
Error: couldn't parse query: invalid argument syntax error at position 13 near 'index'
Hope this helps and I wish you all the best.[1] https://github.com/cube2222/octosql/wiki/Function-Documentat...