title: What is the HiveQL for obtaining day of week?
body: <p>I am selecting date from my table "tweets" as</p>
  
  <pre><code>select to_date(created_at) from tweets;
  </code></pre>
  
  <p>which gives me dates like,</p>
  
  <pre><code>2011-09-28
  2011-09-25
  2011-09-25
  2011-09-24
  </code></pre>
  
  <p>However, I need to convert the dates into a day of week format,
  1 for Monday, 2 for Tuesday, and so on.</p>
  
  <p>How do I achieve this?</p>
  
  <p>Edit: 
  I think I can get the day for a sample date as,</p>
  
  <pre><code>select from_unixtime(unix_timestamp('2014-01-12','yyyyMMdd'),'u');
  </code></pre>
  
  <p>How do I incorporate this in my original query?</p>