title: Apache Hive - Single Insert Date Value
body: <p>I'm trying to insert a date into a date column using Hive. So far, here's what i've tried</p>
  
  <pre><code>INSERT INTO table1 (EmpNo, DOB)
  VALUES ('Clerk#0008000', cast(substring(from_unixtime(unix_timestamp(cast('2016-01-01' as string), 'yyyy-MM-dd')),1,10) as date));
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>INSERT INTO table table1 values('Clerk#0008000', cast(substring(from_unixtime(unix_timestamp(cast('2016-01-01' as string), 'yyyy-MM-dd')),1,10) as date));
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>INSERT INTO table1 SELECT 
  'Clerk#0008000', cast(substring(from_unixtime(unix_timestamp(cast('2016-01-01' as string), 'yyyy-MM-dd')),1,10) as date);
  </code></pre>
  
  <p>But i still get </p>
  
  <pre><code>FAILED: SemanticException [Error 10293]: Unable to create temp file for insert values Expression of type TOK_FUNCTION not supported in insert/values
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>FAILED: ParseException line 2:186 Failed to recognize predicate '&lt;EOF&gt;'. Failed rule: 'regularBody' in statement
  </code></pre>
  
  <p>Hive ACID has been enabled on the ORC based table and simple inserts without dates are working.</p>
  
  <p>I think i'm missing something really simple. But can't put my finger on it.</p>