<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Impala - Convert bigint to timestamp in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/67794#M78027</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/27116"&gt;@VJM&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;You shold use the cast function:&lt;/P&gt;&lt;PRE&gt;select cast(s.conferencedatetime as TIMESTAMP) as starttime from session s;&lt;/PRE&gt;&lt;P&gt;Good luck.&lt;/P&gt;</description>
    <pubDate>Thu, 31 May 2018 17:00:21 GMT</pubDate>
    <dc:creator>AcharkiMed</dc:creator>
    <dc:date>2018-05-31T17:00:21Z</dc:date>
    <item>
      <title>Impala - Convert bigint to timestamp</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/67073#M78026</link>
      <description>&lt;P&gt;I've a table called "session" and it has a column 'conferencedatetime' with datatype as '&lt;STRONG&gt;bigint&lt;/STRONG&gt;'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the output of this column in a date/timestamp format (for e.g. 2018-01-01 01:00:00)&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm not able to get the desired output when I tried with the 'from_unixtime' function. (it returns NULL as output)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please advise what is the correct way to get the output ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;select s.conferencedatetime as starttime from session s ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1500778867943&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;select from_unixtime(s.conferencedatetime, "yyyy-MM-dd HH:mm:ss") as starttime from session s ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;NULL&lt;/FONT&gt;&lt;BR /&gt;--------------------------------&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:11:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/67073#M78026</guid>
      <dc:creator>VJM</dc:creator>
      <dc:date>2022-09-16T13:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Impala - Convert bigint to timestamp</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/67794#M78027</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/27116"&gt;@VJM&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;You shold use the cast function:&lt;/P&gt;&lt;PRE&gt;select cast(s.conferencedatetime as TIMESTAMP) as starttime from session s;&lt;/PRE&gt;&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 17:00:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/67794#M78027</guid>
      <dc:creator>AcharkiMed</dc:creator>
      <dc:date>2018-05-31T17:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Impala - Convert bigint to timestamp</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/67799#M78028</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22966"&gt;@AcharkiMed&lt;/a&gt;&amp;nbsp;- Thanks for the response. But that query also returns NULL as the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I got a resolution for the issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select from_timestamp(CAST(CAST(s.conferencedatetime as decimal(30,0))/1000 AS timestamp), "yyyy-MM-dd HH:mm:ss.SSS") as starttime from session s&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 18:38:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/67799#M78028</guid>
      <dc:creator>VJM</dc:creator>
      <dc:date>2018-05-31T18:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Impala - Convert bigint to timestamp</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/85262#M78029</link>
      <description>&lt;P&gt;I am inserting the data using below column,also myoutput table column has dataype timestamp.&lt;/P&gt;&lt;P&gt;But its not casting it into the timestamp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from_timestamp(cast(T1.converted_start_dt as timestamp),'yyyy-MM-dd HH:mm:ss.SSSSSSSSS') start_dt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggestsolution&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 08:01:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/85262#M78029</guid>
      <dc:creator>kunalkhadse11</dc:creator>
      <dc:date>2019-01-23T08:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Impala - Convert bigint to timestamp</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/88587#M78030</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/23507"&gt;@kunalkhadse11&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share the sample data, the complete query and the actual, expected output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 20:30:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/88587#M78030</guid>
      <dc:creator>Gomathinayagam</dc:creator>
      <dc:date>2019-04-01T20:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Impala - Convert bigint to timestamp</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/90021#M78031</link>
      <description>&lt;P&gt;The same workaround worked for me too - also getting null when selecting from_unixtime(starttime). starttime is bigint. Is this a bug in Impala or ... ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, in hive the following query normally works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT cast(starttime as TIMESTAMP) from dynatracelogs ORDER BY starttime desc LIMIT 100&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but in Impala it returns nulls. ....&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 10:58:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Convert-bigint-to-timestamp/m-p/90021#M78031</guid>
      <dc:creator>NVidak</dc:creator>
      <dc:date>2019-05-07T10:58:56Z</dc:date>
    </item>
  </channel>
</rss>

