Tell HN: Full Hacker News dataset now available on BigQuery
The dataset is up-to-date for October 2015 and uses the official HN API as a data source. (Unfortuntely, this includes the HTML formatting in the comments) Dataset is about 4GB total; since BigQuery allows for 1000GB processing for free each month, it is effectively no cost to analyze.
Felipe Hoffa (who uploaded the dataset) has links to the dataset along with some sample Python code for analysis: https://github.com/fhoffa/notebooks/blob/master/analyzing%20hacker%20news.ipynb
I have a few scripts for downloading all the data manually (https://github.com/minimaxir/get-all-hacker-news-submissions-comments ), but the BigQuery table may be more pragmatic. I can do some more sample queries if requested. (See my BigQuery tutorial for Reddit data: http://minimaxir.com/2015/10/reddit-bigquery/ )
47 comments
[ 0.88 ms ] story [ 94.7 ms ] threadhttps://bigquery.cloud.google.com/table/fh-bigquery:hackerne...
https://github.com/fhoffa/notebooks/blob/master/analyzing%20...
https://github.com/minimaxir/get-all-hacker-news-submissions...
http://minimaxir.com/2015/10/reddit-bigquery/
I like to use Twitter to analyze HN datasets. It's mostly limited to links, because that's what I'm after mostly.
https://twitter.com/newsycombinator https://twitter.com/HackerNews .. And a few other accounts. Try to avoid Bitly wrapped links.
Use something like Greptweet to harvest the tweets and parse out any noise.
You have to look at both the good and the bad.
One thing though: Greptweet has an archive somewhere with a huge trove of tweets that users of the service have searched for, and were thus logged and kept. (Some even go over the 3200 limit). It's a massive Tarball, so set aside time to download it and parse out boring/noisy links.
A lot of HN links are tech-press posts which consist of hearsay and merely proxy the thoughts of others. The recent changes in HN with regards to more academia-style posts is refreshing.
The notebook with sample queries and visualizations:
https://github.com/fhoffa/notebooks/blob/master/analyzing%20...
I'm assuming this data set offers something the API doesn't (that's the point of uploading it, right? Other than just being an easy way for others to "back up" the hn data) -- and that can very well mean there are privacy/personal data implications.
I'm mostly stating this because of the principle, not because I think it's anything wrong with this concrete upload of hn data (and wrong != legal/illegal anyway).
As an example, at least in Norway, while you may have two separate databases that are linked to people, such as a database of cars passing through toll booths, and credit card charges from a large bar/restaurant chain -- it would generally be illegal to link the two.
There is an ongoing conversation about this on reddit: https://www.reddit.com/r/bigdata/comments/3jnam1/whats_your_...
The answer is that the dataset must be very similar to the Algolia one, since both get their data from the same source: the Hacker News official API on Firebase.
(but Algolia keeps it up-to-date in realtime, while I haven't written anything to keep the BigQuery one updated - yet)
FYI, you named a column a reserved sql keyword ('by'). For future reference, and for others reading this: this is bad database design and makes it harder to use the table. You can get around this by wrapping the column name in brackets, like:
>select ... where [by] = ...
And to make everyone's lives easier (including mine), I copied the [by] column to an [author] column, so you can do a
>select ... where author = ...
instead :)
Is there a good way to find the story to which a comment belongs? This dataset raises the issue of recursive query (e.g. "with recursive" in SQLite or PostgreSQL, or "connect by" in Oracle). The only approach I see in BigQuery is specifying a fixed level with something scary like:
For this particular data set: linking each comment to its story might be a good denormalization.My oversight, sorry! :)
I modified it to get the story for up to 7 levels of recursion:
(having so many left joins consumes a lot of resources, so to run it massively I would look for a different strategy)Now for someone to analyze github <-> HN correlations.
https://www.reddit.com/r/bigquery/comments/3cej2b/17_billion...
and wikipedia, and weather, and...
https://www.reddit.com/r/bigquery/wiki/datasets
:)
https://www.reddit.com/r/bigquery/comments/3qpyor/joining_ha...
[1] http://demo.redash.io [2] http://demo.redash.io/queries/667/source#table
I'd be interested to see a list of people who submit a lot. I submit too much - about one submission per day - and I'm curious what percentile that puts me in.