title: How to reformat multiple different dates in Impala/hive
body: <p>In table, there are dates saved in various format. E.g.</p>
  
  <pre><code>19/Jun/1965     
  30-Jun-1980
  29-Mar-1970
  Jun-12-1969
  </code></pre>
  
  <p>I want them to all be saved in same format. I was trying case when approach to sort it into sub-sets and solve each individualy</p>
  
  <pre><code>select birthdate, 
  case 
  when birthdate like '%-%' then cast(unix_timestamp(birthdate, 'dd-MMM-yyyy') as timestamp) 
  when birthdate like '%/%' then cast(unix_timestamp(birthdate, 'dd/MMM/yyyy') as timestamp) 
  end from patientinfo;
  </code></pre>
  
  <p>But this will lead probably into multiple nested case-when queries.  </p>
  
  <p>Is there any better approach how to convert all the data into same date format ? </p>