Skip to content

Instantly share code, notes, and snippets.

@aaronfeng
Created June 6, 2012 14:30
Show Gist options
  • Save aaronfeng/2882234 to your computer and use it in GitHub Desktop.
Save aaronfeng/2882234 to your computer and use it in GitHub Desktop.
hive insert overwrite directory
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