Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
About
People
Publications
Teaching
Resources
Research Blog
Wiki Functions
Recent changes
Help
Licensing
Project page
Discussion
Edit
View history
Editing
CommunityData:CDSC Reddit
(section)
From CommunityData
Jump to:
navigation
,
search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Building Parquet Datasets == Pushshift dumps are huge compressed json files with a lot of metadata that we may not need. It isn’t indexed so it’s expensive to pull data from just a handful of subreddits. It also turns out that it’s a pain to read these compressed files straight into spark. Extracting useful variables from the dumps and building parquet datasets will make them easier to work with. This happens in two steps: # Extracting json into (temporary, unpartitioned) parquet files using pyarrow. # Repartitioning and sorting the data using pyspark. The final datasets are in <code>/gscratch/comdata/output.</code> * <code>reddit_comments_by_author.parquet</code> has comments partitioned and sorted by username (lowercase). * <code>reddit_comments_by_subreddit.parquet</code> has comments partitioned and sorted by subreddit name (lowercase). * <code>reddit_submissions_by_author.parquet</code> has submissions partitioned and sorted by username (lowercase). * <code>reddit_submissions_by_subreddit.parquet</code> has submissions partitioned and sorted by subreddit name (lowercase). Breaking this down into two steps is useful because it allows us to decompress and parse the dumps in the backfill queue and then sort them in spark. Partitioning the data makes it possible to efficiently read data for specific subreddits or authors. Sorting it means that you can efficiently compute agreggations at the subreddit or user level. More documentation on using these files is available [https://wiki.communitydata.science/CommunityData:Hyak_Datasets#Reading_Reddit_parquet_datasets here].
Summary:
Please note that all contributions to CommunityData are considered to be released under the Attribution-Share Alike 3.0 Unported (see
CommunityData:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:
Cancel
Editing help
(opens in new window)
Tools
What links here
Related changes
Special pages
Page information