Last active
January 13, 2021 11:19
-
-
Save xoelop/d3223004ce4255848ea3b9efc427b296 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% | |
SELECT * FROM all_likes | |
WHERE match(lower(text), replaceRegexpAll({{String(search_term, ' ', description="Return tweets whose text matches this word (can include a regex pattern)", required=True)}}, ' ', '.?')) | |
AND ( | |
multiSearchAnyCaseInsensitive(screenname, splitByString(',', {{String(usernames, ',', description="User names or handles, comma-separated")}})) | |
OR multiSearchAnyCaseInsensitive(username, splitByString(',', {{String(usernames, ',', description="User names or handles, comma-separated")}})) | |
) | |
AND date >= toStartOfDay(toDate({{Date(since, '2000-09-09', description="Start date, YYYY-MM-DD")}})) | |
AND date <= addDays(toStartOfDay(toDate({{Date(until, '2100-09-09', description="End date, YYYY-MM-DD")}})), 1) | |
ORDER BY date desc | |
LIMIT {{Int32(limit, 20000000, description="Max number of tweets to return", required=True)}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment