title: Get current unix_timestamp in Hive
body: <p>As the post <a href="https://stackoverflow.com/questions/17905873/how-to-select-current-date-in-hive-sql">How to select current date in Hive SQL</a>, to get the current date in Hive, <code>unix_timestamp</code> can be used.</p>
  
  <p>But I tried</p>
  
  <pre><code>select unix_timestamp();
  </code></pre>
  
  <p>and just,</p>
  
  <pre><code>unix_timestamp();
  </code></pre>
  
  <p>both give the error messages</p>
  
  <pre><code>FAILED: ParseException line 1:23 mismatched input '&lt;EOF&gt;' expecting FROM near ')' in from clause
  FAILED: ParseException line 1:0 cannot recognize input near 'unix_timestamp' '(' ')'
  </code></pre>
  
  <p>respectively.</p>
  
  <p>How can I use <code>unix_timestamp</code> properly in Hive?</p>
  
  <h1>UPDATED!</h1>
  
  <p><a href="https://issues.apache.org/jira/browse/HIVE-178" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/HIVE-178</a> has resolved this issue.</p>
  
  <p>If you use 0.13 (released on 21 April 2014) or above, you can</p>
  
  <pre><code>-- unix_timestamp() is deprecated
  select current_timestamp();
  select 1+1;
  </code></pre>
  
  <p>without <code>from &lt;table&gt;</code>.</p>