Live data from Hacker News

Joining CSV Data Without SQL: An IP Geolocation Use Case

brimdata.io

31–40 of 41 posts

Re: Joining CSV Data Without SQL: An IP Geolocation Use Case

#31
post #11

If you really want to, there's also the `join` command, which has been part of the standard unix toolset for longer than many of us have been alive.

Many years ago, I got sidetracked with sorting, joining, and processing (grepping, counting, etc) large text files ... until I realized I was just re-inventing a very slow database.

Re: Joining CSV Data Without SQL: An IP Geolocation Use Case

#32

> a performant join that avoids the hassle of SQL tables. Hm, a hassle is not always the same hassle for everyone. Personally, I like SQL and I enjoy the power it can leverage on all kind of data. As others wrote, working with sqlite for local data processing is a tool I do not want to miss, besides all of the great Unix coreutils and its (mostly GNU) ecosystem.

I wasn't aware, but some developers do seem to be allergic to SQL at all cost and would go to great lengths to avoid it just because.

Wow yes. I just found this out recently, it's funny because Sql seems easier than most of the complicated shit a dev needs to deal with.

Re: Joining CSV Data Without SQL: An IP Geolocation Use Case

#33

Earlier quoted context omitted.

People that do proper ETL don't use python

Real programmers use butterflies. https://xkcd.com/378/

Now I wonder if Raku developers chose the mascot thanks to this particular XKCD: https://en.m.wikipedia.org/wiki/File:Camelia.svg

Re: Joining CSV Data Without SQL: An IP Geolocation Use Case

#34

I have done some similar, simpler data wrangling with xsv ( https://github.com/BurntSushi/xsv ) and jq. It could process my 800M rows in a couple of minutes (plus the time to read it out from the database =)

qsv has more features nowadays:

https://github.com/jqnatividad/qsv

Re: Joining CSV Data Without SQL: An IP Geolocation Use Case

#35
post #16

I‘d rather just use DuckDB and write a few SQLs, and be done. This can be done in the terminal as well.

I also agree with this point. Importing the CSV into a relational database and using standard SQL operations may be more user-friendly for subsequent maintenance. Of course, this relational database should be lightweight and easy to use (e.g. sqlite)

Re: Joining CSV Data Without SQL: An IP Geolocation Use Case

#36

I have done some similar, simpler data wrangling with xsv ( https://github.com/BurntSushi/xsv ) and jq. It could process my 800M rows in a couple of minutes (plus the time to read it out from the database =)

A long time ago, we were trying to compare a couple of tables with a few hundred million rows in each to see whether the differences (due to a new way of processing) were allowable. Our local Oracle Boy whipped up a query, set it running, and we all sat around for hours whilst it churned - end result being we could do one comparison a day. After a while, I experimented with dumping the tables as CSV, through `sort`, and then using some Perl to compare each paired (or not!) line with some heuristics for quick rejection. That all took about 1-2 hours meaning we could get through three, maybe four, tests a day instead.

Re: Joining CSV Data Without SQL: An IP Geolocation Use Case

#37
post #33

Earlier quoted context omitted.

Real programmers use butterflies. https://xkcd.com/378/

Now I wonder if Raku developers chose the mascot thanks to this particular XKCD: https://en.m.wikipedia.org/wiki/File:Camelia.svg

Timing wise, it could very well have influenced Larry Wall at the time!

Re: Joining CSV Data Without SQL: An IP Geolocation Use Case

#39
post #8

Please don’t do this for actual work you share with other people. There’s a good reason why pandas exists.

People that do proper ETL don't use python

I wish they did though. 80% of my day job is (admittedly non-traditional) ETL. It's done in 100% PySpark.

More composable than SQL. Have plenty of utility functions wrapped up (which are far easier than stored procedures) in libraries. The code is far easier to step through with a debugger (due to the composability).

Re: Joining CSV Data Without SQL: An IP Geolocation Use Case

#40
I needed to do this yesterday. Thankfully I recall a hacker news suggestion to use SQLite. No time at all to get both files imported into tables and successful join queries. I’m glad it was SQL as I needed a few basic transforms (case folding, trim, etc) and conditions.
Post reply on HN