<?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 Sting to Timestamp (6) in Hive in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Sting-to-Timestamp-6-in-Hive/m-p/401036#M251048</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I’m seeking your support in converting a string to a timestamp with microseconds in Hive. When using unixtimestamp, I notice that the milliseconds are being dropped. Could you please advise on how to capture milliseconds (and microseconds) correctly, and which data type I should use to store the value in Hive?&lt;/P&gt;&lt;P&gt;SELECT from_unixtime(unix_timestamp('2024-11-05-10.03.17.872195', 'yyyy-MM-dd-HH.mm.ss.SSSSSS')) as times,'2024-11-05-10.03.17.872195' as vale&lt;BR /&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="APentyala_0-1737902409390.png" style="width: 483px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43690i44757633E4F12313/image-dimensions/483x122?v=v2" width="483" height="122" role="button" title="APentyala_0-1737902409390.png" alt="APentyala_0-1737902409390.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jan 2025 14:41:08 GMT</pubDate>
    <dc:creator>APentyala</dc:creator>
    <dc:date>2025-01-26T14:41:08Z</dc:date>
    <item>
      <title>Sting to Timestamp (6) in Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Sting-to-Timestamp-6-in-Hive/m-p/401036#M251048</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I’m seeking your support in converting a string to a timestamp with microseconds in Hive. When using unixtimestamp, I notice that the milliseconds are being dropped. Could you please advise on how to capture milliseconds (and microseconds) correctly, and which data type I should use to store the value in Hive?&lt;/P&gt;&lt;P&gt;SELECT from_unixtime(unix_timestamp('2024-11-05-10.03.17.872195', 'yyyy-MM-dd-HH.mm.ss.SSSSSS')) as times,'2024-11-05-10.03.17.872195' as vale&lt;BR /&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="APentyala_0-1737902409390.png" style="width: 483px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43690i44757633E4F12313/image-dimensions/483x122?v=v2" width="483" height="122" role="button" title="APentyala_0-1737902409390.png" alt="APentyala_0-1737902409390.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2025 14:41:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Sting-to-Timestamp-6-in-Hive/m-p/401036#M251048</guid>
      <dc:creator>APentyala</dc:creator>
      <dc:date>2025-01-26T14:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sting to Timestamp (6) in Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Sting-to-Timestamp-6-in-Hive/m-p/401434#M251155</link>
      <description>&lt;P&gt;Any inputs?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 07:44:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Sting-to-Timestamp-6-in-Hive/m-p/401434#M251155</guid>
      <dc:creator>APentyala</dc:creator>
      <dc:date>2025-02-04T07:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sting to Timestamp (6) in Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Sting-to-Timestamp-6-in-Hive/m-p/401447#M251158</link>
      <description>&lt;P&gt;Use CAST to convert to TIMESTAMP type.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;SELECT CAST('2024-11-05 10:03:17.872195' AS TIMESTAMP) AS timestamp_value;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;We can also try TIMESTAMP WITH LOCAL TIME ZONE, This helps retain precision when dealing with timezones.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;SELECT CAST('2024-11-05 10:03:17.872195' AS TIMESTAMP WITH LOCAL TIME ZONE);&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 14:33:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Sting-to-Timestamp-6-in-Hive/m-p/401447#M251158</guid>
      <dc:creator>ggangadharan</dc:creator>
      <dc:date>2025-02-04T14:33:33Z</dc:date>
    </item>
  </channel>
</rss>

