title: How to get a datetime in a format from hive query?
body: <pre><code>hql=&quot;
    select DISTINCT b.mid, from_unixtime(b.create_time,'yyyy-MM-dd hh.mm.ss'), to_id from
        (select mid, create_time, to_id, dt from mark_table where dt&gt;=$dt1 and dt&lt;=$dt2 and to_id = 'Category_001' ) b
     
    &quot;
  </code></pre>
  <p>I have a hive query above, and the 'b.create_time' is a column with date, but the default time format of this column is like this:</p>
  <pre><code>1594553700
  </code></pre>
  <p>I think it is time in seconds? I hope to convert it using this:</p>
  <pre><code>from_unixtime(b.create_time,'yyyy-MM-dd hh.mm.ss')
  </code></pre>
  <p>But it gives an error, saying that b.create_time can't be a string for that function to work.</p>
  <p>How to deal with this?</p>