Member since
10-24-2017
2
Posts
0
Kudos Received
0
Solutions
10-24-2017
10:39 AM
I have a query wherein I need to extract timestamp with milliseconds to match data from Source. Below is sample data from SQL server (Source) and column is defined as Datetime U_Date 2007-10-26 10:07:00.000 2005-05-04 11:12:54.297 2004-05-29 03:56:24.792 Target is Hadoop through Impala and defined as Timestamp U_Date 2007-10-26 10:07:00 2005-05-04 11:12:54.297000000 2013-05-31 04:07:00 2013-11-01 15:34:00 I am looking for query to get timestamp as displayed in Source with millisecond. I have put together my query as under, but it defaults milliseconds to 000. select from_unixtime(unix_timestamp(u_date),'yyyy-MM-dd HH:mm:ss.SSS') from table A Generated result set is as below: 2007-10-26 10:07:00.000 2005-05-04 11:12:54.000 (Millisecond .297 defaulted to 000) 2013-05-31 04:07:00.000 2013-11-01 15:34:00.000 Kindly share your inputs
... View more
Labels:
- Labels:
-
Apache Impala