n = 50000
min_timestamp = '2000-01-01T00:00:00Z' # start of time

"""
Explanation: Random Sample
Consider comments made since min_timestamp. Take n random comments from non-bot users.
Params
End of explanation
"""


t1 = time.time()
query = """
SELECT 
    *
FROM
    enwiki.article_talk_diff_no_bot_sample
WHERE
    rev_timestamp > '%(min_timestamp)s'
    AND ns = 'article'
LIMIT %(n)d
"""

params = {
    'n': int(n * 1.7),
    'min_timestamp': min_timestamp
    }

df = query_hive_ssh(query % params, '../../data/raw_random_sample.tsv', priority = True, quoting=3, delete = True)
df.columns = [c.split('.')[1] for c in df.columns]
t2 = time.time()
print('Query and Download Time:', (t2-t1) / 60.0)

dfc = clean(df[300:500])

show_comments(dfc, 100)

"""
Explanation: Query
End of explanation
"""


