[okfn-labs] Quick and dirty analytics on large CSVs - what's the best approach?

Michael Bauer michael.bauer at okfn.org
Fri Apr 12 07:28:09 UTC 2013


Stefan,

How about multiprocessing.Pool? I'm not sure how this works out for sorting
and things that don't really map things (drilldowns are rather reduce...)

One thing you can do is of course use Open Spending for analysis (We had
done exactly this questions at the summit with a couple of beers - using
the OS API and R). So what you really want here IMO is some kind of OLAP
system.

Michael

On Fri, Apr 12, 2013 at 02:39:27AM +0200, Stefan Wehrmeyer wrote:
> Hi Rufus,
> 
> a (Python) script that streams the file through should run in constant space and linear time which should be good enough for offline analytics purposes (and small enough sizes).
> 
> If you need it faster, run it in parallel. Hadoop (for sure) and BigQuery (I assume) also come with their own engineering overhead though. Hadoop is more difficult to built, setup and deploy (even on EC2) for quick and dirty.
> 
> If you ever going to really run it once, Postgres seems to much of a hassle and is also not that fast (index building takes time).
> 
> To keep it quick and dirty a streaming M/R style python script is the way, maybe coupled with an in-memory datastore like Redis.
> If it gets to slow for one machine, split it up with e.g. http://www.picloud.com/ 
> 
> Cheers
> Stefan
> 
> On 11.04.2013, at 19:04 , Rufus Pollock <rufus.pollock at okfn.org> wrote:
> 
> > Hi folks,
> > 
> > I'm playing around with some largish CSV files as part of a data
> > investigation for OpenSpending to look at which companies got paid the
> > most by (central) government in the UK last year. (More details can be
> > found in this issue:
> > <https://github.com/openspending/thingstodo/issues/5>)
> > 
> > The dataset i'm working with is the UK departmental spending which,
> > thanks to Friedrich's efforts, is already nicely ETL'd into one big
> > 3.7 Gb file [1].
> > 
> > My question is do folks have any thoughts on how best to do quick and
> > dirty analytics on this? In particular, I was considering options
> > like:
> > 
> > * Postgresql - load, build indexes and then sum, avg etc (already
> > started on this)
> > * Elastic MapReduce (AWS Hadoop)
> > * Google BigQuery
> > 
> > Let me know your thoughts!
> > 
> > Regards,
> > 
> > Rufus
> > 
> > [1]: Details of the file
> > https://github.com/openspending/thingstodo/issues/5#issuecomment-16222168
> > 
> > _______________________________________________
> > okfn-labs mailing list
> > okfn-labs at lists.okfn.org
> > http://lists.okfn.org/mailman/listinfo/okfn-labs
> > Unsubscribe: http://lists.okfn.org/mailman/options/okfn-labs
> 
> 
> _______________________________________________
> okfn-labs mailing list
> okfn-labs at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/okfn-labs
> Unsubscribe: http://lists.okfn.org/mailman/options/okfn-labs

-- 
Data Wrangler with the Open Knowledge Foundation (OKFN.org)
GPG/PGP key: http://tentacleriot.eu/mihi.asc
Twitter: @mihi_tr Skype: mihi_tr




More information about the okfn-labs mailing list