title: Hive select columns to do a case statement on
body: <p>This will export the data from dynamodb dynamically to s3. </p>
  
  <pre><code>-- Load S3 Table with data from DynamoDB
  INSERT OVERWRITE TABLE s3_table SELECT * FROM dynamodb_table;
  </code></pre>
  
  <p>The problem is that it leaves in a bunch of <code>\N</code>. I can write it by hand it will look something like</p>
  
  <pre><code>-- Load S3 Table with data from DynamoDB
     INSERT OVERWRITE TABLE s3_table SELECT DCS_ID, CASE WHEN MAKE IS NULL THEN "" ELSE MAKE END, CASE WHEN MODEL IS NULL THEN "" ELSE MODEL END FROM dynamodb_table; 
  </code></pre>
  
  <p>The problem is selecting the columns to say "When <strong>Column</strong> is NULL Then "" Else <strong>Column</strong> End"</p>
  
  <p>The current output looks like this </p>
  
  <pre><code>PORTAL  1.5.1.25.2      2013-08-09 13:45:20.126 2013-08-09 13:45:20.282 \N      \N      \N      \N      \N      \N
  </code></pre>
  
  <p>The desired ouput looks like this </p>
  
  <pre><code>PORTAL  1.5.1.25.2      2013-08-13 18:18:24.667 2013-08-13 18:18:24.832 
  </code></pre>