<?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: HIVE  datatype Timestamp with miliseconds in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150946#M24124</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/189/jramakrishnan.html" nodeid="189"&gt;@jramakrishnan&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for the answer. However this is not so valid for me as my data in HDFS is already in TimeStamp &lt;/P&gt;&lt;P&gt;'YYYY-MM-DD HH:MM:SS.sss'&lt;/P&gt; just that HIVE TimeStamp data type is chopping off the miliseconds part.&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rohit &lt;/P&gt;</description>
    <pubDate>Fri, 01 Apr 2016 10:12:38 GMT</pubDate>
    <dc:creator>rohit_sureka</dc:creator>
    <dc:date>2016-04-01T10:12:38Z</dc:date>
    <item>
      <title>HIVE  datatype Timestamp with miliseconds</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150944#M24122</link>
      <description>&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;I have some data with Timestamp that has mili seconds as &lt;/P&gt;&lt;P&gt;'2015-01-16 20:40:00.0' 'YYYY-MM-DD HH:MM:SS.sss' When I chose data type as TimeStamp in HIVE its removing the mili seconds part from the time stamp.&lt;/P&gt;&lt;P&gt;Any suggestion is highly appreciated.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Rohit Sureka&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 15:11:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150944#M24122</guid>
      <dc:creator>rohit_sureka</dc:creator>
      <dc:date>2016-03-31T15:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: HIVE  datatype Timestamp with miliseconds</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150945#M24123</link>
      <description>&lt;P&gt;&lt;A rel="user" href="#"&gt;@Rohit Sureka&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;You need to cast them as  below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select cast(regexp_replace('20141014123456789', 
                           '(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{3})',
                           '$1-$2-$3 $4:$5:$6.$7') as timestamp) &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;REF : &lt;A href="http://stackoverflow.com/questions/26355194/how-to-convert-a-string-to-timestamp-with-milliseconds-in-hive" target="_blank"&gt;http://stackoverflow.com/questions/26355194/how-to-convert-a-string-to-timestamp-with-milliseconds-in-hive&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 15:19:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150945#M24123</guid>
      <dc:creator>Jagatheeshr</dc:creator>
      <dc:date>2016-03-31T15:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: HIVE  datatype Timestamp with miliseconds</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150946#M24124</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/189/jramakrishnan.html" nodeid="189"&gt;@jramakrishnan&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for the answer. However this is not so valid for me as my data in HDFS is already in TimeStamp &lt;/P&gt;&lt;P&gt;'YYYY-MM-DD HH:MM:SS.sss'&lt;/P&gt; just that HIVE TimeStamp data type is chopping off the miliseconds part.&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rohit &lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 10:12:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150946#M24124</guid>
      <dc:creator>rohit_sureka</dc:creator>
      <dc:date>2016-04-01T10:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: HIVE  datatype Timestamp with miliseconds</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150947#M24125</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3519/rohitsureka.html" nodeid="3519"&gt;@Rohit Sureka&lt;/A&gt; . Yes. But when you query the data as above , Are you not getting Milli Second Info.&lt;/P&gt;&lt;P&gt;As per the official doc, Hive Supports traditional UNIX timestamp with optional nanosecond precision.&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-Timestamps" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-Timestamps&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 11:51:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150947#M24125</guid>
      <dc:creator>Jagatheeshr</dc:creator>
      <dc:date>2016-04-01T11:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: HIVE  datatype Timestamp with miliseconds</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150948#M24126</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/189/jramakrishnan.html" nodeid="189"&gt;@jramakrishnan&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Yes that's the problem. I also read this document it says it supports miliseconds but when I select the data it chops the miliseconds.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 11:53:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150948#M24126</guid>
      <dc:creator>rohit_sureka</dc:creator>
      <dc:date>2016-04-01T11:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: HIVE  datatype Timestamp with miliseconds</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150949#M24127</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/3519/rohitsureka.html" nodeid="3519"&gt;@Rohit Sureka&lt;/A&gt;, I just tried (HDP-2.3.2 sandbox) and for me the timestamp works per documentation, with up to 9 decimal places (nanoseconds). Can you check your input data, and delimiters of your fields, are they as expected. Here is my test. My table:&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; create table ts(id int, t timestamp) row format delimited fields terminated by ',' stored as textfile location '/user/it1/hive/ts';
&lt;/PRE&gt;&lt;P&gt;A few lines of my input file&lt;/P&gt;&lt;PRE&gt;11,2015-11-01 21:10:00 
12,2015-11-01 21:10:00.1 
15,2015-11-01 21:10:00.123
&lt;/PRE&gt;&lt;P&gt;And a select/order by command&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; select * from ts order by t;
OK
11	2015-11-01 21:10:00
12	2015-11-01 21:10:00.1
25	2015-11-01 21:10:00.1190011
37	2015-11-01 21:10:00.12
15	2015-11-01 21:10:00.123
31	2015-11-01 21:10:00.1234
17	2015-11-01 21:10:00.12345
19	2015-11-01 21:10:00.123456789
21	2015-11-01 21:10:00.490155
57	2015-11-01 21:10:00.60015589
Time taken: 2.34 seconds, Fetched: 10 row(s)&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Apr 2016 20:58:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150949#M24127</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-04-03T20:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: HIVE  datatype Timestamp with miliseconds</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150950#M24128</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/177/pminovic.html" nodeid="177"&gt;@Predrag Minovic&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you very much it helps. I checked it again its working.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 14:46:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150950#M24128</guid>
      <dc:creator>rohit_sureka</dc:creator>
      <dc:date>2016-04-04T14:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: HIVE  datatype Timestamp with miliseconds</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150951#M24129</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/3519/rohitsureka.html" nodeid="3519"&gt;@Rohit Sureka&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Did you find a solution for this?
I am also facing same issue, In my use case I want to add a field for current timestamp with 9 decimal place precision.&lt;/P&gt;&lt;P&gt;Hive (v 1.1.0) is giving up to only 3 decimal place, I also tried by casting it in String but no luck.&lt;/P&gt;&lt;P&gt;As per hive official document: &lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-TimestampstimestampTimestamps" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-TimestampstimestampTimestamps&lt;/A&gt;&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;H3&gt;Timestamps&lt;/H3&gt;&lt;P&gt;Supports traditional UNIX timestamp with optional nanosecond precision.&lt;/P&gt;&lt;P&gt;Supported conversions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Integer numeric types: Interpreted as UNIX timestamp in seconds&lt;/LI&gt;&lt;LI&gt;Floating point numeric types: Interpreted as UNIX timestamp in seconds with decimal precision&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Strings: JDBC compliant java.sql.Timestamp format "&lt;CODE&gt;YYYY-MM-DD HH:MM:SS.fffffffff&lt;/CODE&gt;" (9 decimal place precision)&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;Thanks In advance.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 15:27:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150951#M24129</guid>
      <dc:creator>PVikash</dc:creator>
      <dc:date>2017-02-03T15:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: HIVE  datatype Timestamp with miliseconds</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150952#M24130</link>
      <description>&lt;P&gt;When we ingest the following data&lt;/P&gt;&lt;PRE&gt;2015-11-01 21:10:00.1
2015-11-01 21:10:00.1190011
2015-11-01 21:10:00.12
2015-11-01 21:10:00.123
2015-11-01 21:10:00.1234
2015-11-01 21:10:00.12345
2015-11-01 21:10:00.123456789
2015-11-01 21:10:00.490155
2015-11-01 21:10:00.1234567890
2015-11-01 21:10:00.1234567890123456789
&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;I get the following when I do the "select", I get NULL for the last two rows instead of just truncating the additional digits. &lt;STRONG&gt;This is HDP 2.6.1 &amp;amp; Hive 1.2.1000&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;select * from test_timestamp;
+--------------------------------+--+
|       test_timestamp.col       |
+--------------------------------+--+
| 2015-11-01 21:10:00.1          |
| 2015-11-01 21:10:00.1190011    |
| 2015-11-01 21:10:00.12         |
| 2015-11-01 21:10:00.123        |
| 2015-11-01 21:10:00.1234       |
| 2015-11-01 21:10:00.12345      |
| 2015-11-01 21:10:00.123456789  |
| 2015-11-01 21:10:00.490155     |
| NULL                           |
| NULL                           |
&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Oct 2017 22:41:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HIVE-datatype-Timestamp-with-miliseconds/m-p/150952#M24130</guid>
      <dc:creator>yaravind1</dc:creator>
      <dc:date>2017-10-13T22:41:55Z</dc:date>
    </item>
  </channel>
</rss>

