1

I have the data in the date column = 2019-10-01 00:00:00 UTC, Now how to insert this data into a column without the UTC word ? and Hive should recognize this as timestamp datatype

leftjoin
  • 36,950
  • 8
  • 57
  • 116
  • Does this answer your question? [Hive convert UTC string into datetime](https://stackoverflow.com/questions/26006403/hive-convert-utc-string-into-datetime) – droebi Oct 22 '21 at 07:19

1 Answers1

0

You can remove UTC using regexp_replace:

select timestamp(regexp_replace('2019-10-01 00:00:00 UTC','\\s*UTC$',''))

Result:

2019-10-01 00:00:00.0

It is successfully converted to timestamp.

leftjoin
  • 36,950
  • 8
  • 57
  • 116