title: string to date - hive SQL
body: <p>I am running queries in a hive environment.</p>
  
  <p>I have a column which has a timestamp but is set up a string in the tables. I tried the following : all of them return Null </p>
  
  <pre><code>SELECT 
  ,To_date(activitydate)
  </code></pre>
  
  <p>Cast:</p>
  
  <pre><code>,cast(activitydate as timestamp)
  </code></pre>
  
  <p>This is the how the data is set up in the table:</p>
  
  <p>Appreciate any inputs on how I can convert this :</p>
  
  <pre><code>05/12/2017 00:00:00     
  
  
  
  SELECT 
   cust_id
  ,to_date(activitydate)  activity_date
  ,type type_of_contact
  
  
  FROM repl_task
  
  WHERE to_date(activitydate) BETWEEN '2014-01-01' AND '2017-01-01' ;
  </code></pre>
  
  <p>I am running out of memory if I run this :</p>
  
  <pre><code>SELECT 
   cust_id
  ,activitydate
  ,SUBSTR(activitydate,4,2) AS DT
  ,SUBSTR(activitydate,0,2) AS MONTH 
  ,SUBSTR(activitydate,7,4) AS YEAR
  ,type 
  
  
  FROM task 
  
  WHERE activitydate &gt;='01/01/2016 00:00:00'
  </code></pre>