Created
December 16, 2013 20:21
-
-
Save randyzwitch/7993686 to your computer and use it in GitHub Desktop.
Example hive query
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
-- This will give me back a text file for every reducer, then I need to cat * > outfile to get a single text file | |
-- Feels like there should be a simple setting to tell Hive that I want a single text file back | |
--query_history | |
insert overwrite local directory '/tmp/hive/old_backup/query_history' | |
select | |
to_date(from_unixtime(CAST(created as int))) as query_date, | |
account_code, | |
audit_key, | |
entity_code, | |
provider_code, | |
count(token) as records | |
from query_history | |
group by to_date(from_unixtime(CAST(created as int))), account_code, audit_key, entity_code, provider_code; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment