I am doing data mining on Reddit data on Google BigQuery and I wanna top 1000 posts ranked by the score for each subreddit for the whole 201704 data. I have tried different techniques but due to the limitation of BigQuery, the result is too large to return.
select body, score, subreddit from
(
select body, score, subreddit,row_number() over
(
partition by subreddit order by score desc
) mm
from [fh-bigquery:reddit_comments.2017_04]
)
where mm <= 1000 AND subreddit in
(
select subreddit from
(
select Count(subreddit) as counts, subreddit from
[fh-bigquery:reddit_comments.2017_04] GROUP BY subreddit ORDER BY counts DESC
LIMIT 10000
)
)
LIMIT 10000000
Is there any way to divide and conquer this problem since enabling large query results means could not do any complex query. Does Google provide payment option for large query resource?