Skip to content

Instantly share code, notes, and snippets.

@Altech
Created April 7, 2013 06:30
Show Gist options
  • Save Altech/5329303 to your computer and use it in GitHub Desktop.
Save Altech/5329303 to your computer and use it in GitHub Desktop.
valid HiveQLs on TreasureData.
-- Schema: (
-- path:string
-- method:string
-- ip:string
-- agent:string
-- referer:string
-- )
-- count access per day
SELECT to_date(from_unixtime(time)) AS day, COUNT(*) AS cnt FROM access GROUP BY to_date(from_unixtime(time)) ORDER BY day ASC
-- referer
SELECT referer, COUNT(*) AS cnt FROM access GROUP BY referer ORDER BY referer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment