]> code.communitydata.science - cdsc_reddit.git/blobdiff - submissions_2_parquet.py
Secondary sort for the by_author dataset should be CreatedAt.
[cdsc_reddit.git] / submissions_2_parquet.py
index 6e46970a8139e58028d9504500be7bb640186fb0..014221044fb266a02d071b0106aeb59a02ed7e24 100755 (executable)
@@ -201,7 +201,7 @@ df2.write.parquet("/gscratch/comdata/output/reddit_submissions_by_subreddit.parq
 
 
 # we also want to have parquet files sorted by author then reddit. 
-df3 = df.sort(["author","subreddit","id","Year","Month","Day"],ascending=True)
+df3 = df.sort(["author","CreatedAt","subreddit","id","Year","Month","Day"],ascending=True)
 df3.write.parquet("/gscratch/comdata/output/reddit_submissions_by_author.parquet", partitionBy=["Year",'Month'], mode='overwrite')
 
 os.remove("/gscratch/comdata/output/reddit_submissions.parquet_temp")

Community Data Science Collective || Want to submit a patch?