Skip to content

Instantly share code, notes, and snippets.

@qi-qi
Created March 4, 2019 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qi-qi/8d18baf987e7a382bb844b320a5baddb to your computer and use it in GitHub Desktop.
Save qi-qi/8d18baf987e7a382bb844b320a5baddb to your computer and use it in GitHub Desktop.
join stats with cdn bytes served
SELECT t1.event_date,
t1.ip,
t1.ua_source,
t1.best_effort_user_id,
t1.episode_url,
t1.method,
t1.status,
t1.range_req,
t1.content_length,
t2.bytes,
t1.client_type,
t1.is_rt,
transform(t1.ads, ad -> ad.i) as ad,
t1.request_id AS cdn_request_id
FROM data_raw.batch t1
join test.cf_stitch t2 on t1.request_id = t2.request_id
WHERE t1.dt='2019-03-02' AND t1.h IN ('13','14','15')
ORDER BY ip, ua_source, best_effort_user_id, episode_url, method, status, event_date limit 10000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment