title: Specifying compression codec for a INSERT OVERWRITE SELECT in Hive
body: <p>I have a hive table like</p>
  
  <pre><code>  CREATE TABLE beacons
   (
       foo string,
       bar string,
       foonotbar string
   )
   COMMENT "Digest of daily beacons, by day"
   PARTITIONED BY ( day string COMMENt "In YYYY-MM-DD format" );
  </code></pre>
  
  <p>To populate, I am doing something like:</p>
  
  <pre><code> SET hive.exec.compress.output=True;
   SET io.seqfile.compression.type=BLOCK;
  
   INSERT OVERWRITE TABLE beacons PARTITION ( day = "2011-01-26" ) SELECT
     someFunc(query, "foo") as foo,
     someFunc(query, "bar") as bar,
     otherFunc(query, "foo||bar") as foonotbar
     )
    FROM raw_logs
  WHERE day = "2011-01-26";
  </code></pre>
  
  <p>This builds a new partition with the individual products compressed through deflate, but the ideal here would be to go through the LZO compression codec instead.</p>
  
  <p>Unfortunately I am not exactly sure how to accomplish that, but I assume it's one of the many runtime settings or perhaps just an additional line in the CREATE TABLE DDL.</p>