Hive TimeStamp Convertion from GreenPlum Code

Viewed 27

Please help me to convert below Greenplum code to Hive supported one.

GP:

date_trunc('second', now())::timestamp without time zone load_time

Expecting to convert similar operation and output in hive

1 Answers
select timestamp(substr(current_timestamp,1,19)) as load_time

Result:

2022-02-08 13:18:27.0

substr() leaves only seconds, works as truncate. and timestampt() - to convert from string to timestamp datatype.

Related