title: Date comparison in Hive
body: <p>I'm working with Hive and I have a table structured as follows:</p>
  
  <pre><code>CREATE TABLE t1 (
    id INT,
    created TIMESTAMP,
    some_value BIGINT
  );
  </code></pre>
  
  <p>I need to find every row in <code>t1</code> that is less than 180 days old. The following query yields no rows even though there is data present in the table that matches the search predicate.</p>
  
  <pre><code>select * 
  from t1 
  where created &gt; date_sub(from_unixtime(unix_timestamp()), 180);
  </code></pre>
  
  <p>What is the appropriate way to perform a date comparison in Hive?</p>