twitter-algorithm/ann/src/main/python/dataflow/bq.sql
twitter-team ef4c5eb65e Twitter Recommendation Algorithm
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
2023-03-31 17:36:31 -05:00

6 lines
409 B
SQL

WITH maxts as (SELECT as value MAX(ts) as ts FROM `twttr-recos-ml-prod.ssedhain.twhin_tweet_avg_embedding`)
SELECT entityId, embedding
FROM `twttr-recos-ml-prod.ssedhain.twhin_tweet_avg_embedding`
WHERE ts >= (select max(maxts) from maxts)
AND DATE(TIMESTAMP_MILLIS(createdAt)) <= (select max(maxts) from maxts)
AND DATE(TIMESTAMP_MILLIS(createdAt)) >= DATE_SUB((select max(maxts) from maxts), INTERVAL 1 DAY)