1

I'm trying to convert from string to timestamp in hive I'm using mentioned below code

from_unixtime(unix_timestamp("12/20/2012 00:54:26.001000", "MM/dd/yyyy HH:mm:ss.SSSSSS"),"yyyy-MM-dd HH:mm:ss.SSSSSS") as CURR_TS

I'm getting output as 12/20/2012 00:54:27(seconds getting round off) but I want output as 12/20/2012 00:54:26.001000

Anas
  • 971
  • 13
  • 28
santosh
  • 11
  • 2
  • iam facing this error while changed to ffffffError while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask – santosh Jul 20 '18 at 10:05
  • unix_timestamp does not support ms apparently. Possible duplicate of https://stackoverflow.com/questions/31701847/hives-unix-timestamp-and-from-unixtime-functions – Kzryzstof Jul 20 '18 at 10:09
  • bad time and date status – santosh Jul 20 '18 at 10:12
  • 1
    my requirement to get exactly same – santosh Jul 20 '18 at 10:20
  • Possible duplicate of [Hive's unix\_timestamp and from\_unixtime functions](https://stackoverflow.com/questions/31701847/hives-unix-timestamp-and-from-unixtime-functions) – Kzryzstof Jul 20 '18 at 12:36
  • Have a look also at this answer please https://stackoverflow.com/a/42975950/2700344 – leftjoin Jul 21 '18 at 16:49

0 Answers0