Created
June 6, 2012 14:30
-
-
Save aaronfeng/2882234 to your computer and use it in GitHub Desktop.
hive insert overwrite directory
This file contains 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
INSERT OVERWRITE DIRECTORY '${OUTPUT_BUCKET}/results/report/region=${REGION}/dt=${DATE}' | |
SELECT | |
dt, | |
col1, | |
col2, | |
col3, | |
col4, | |
col5, | |
col6, | |
avg(col7) col7, | |
avg(col8) col8, | |
avg(col9) col9, | |
avg(col10) col10, | |
avg(col11) col11, | |
avg(col12) col12, | |
avg(col13) col13, | |
avg(col14) col14, | |
avg(col15) col15, | |
count(*) samples | |
FROM tmp | |
GROUP BY dt, | |
col0, | |
col1, | |
col2, | |
col3, | |
col4, | |
col5, | |
col6; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment