Dinesh Madhup
Dinesh Madhup

Reputation: 367

How to convert Oracle SQL date time into Hive Query format and then perform subtraction?

I am converting Oracle SQL time to Hive format.

Oracle: TO_DATE(CURRENT_DATE)- INTERVAL '1' MINUTE

How can I write above in Hive Query?

For this part I can write like this:

TO_DATE( FROM_UNIXTIME( UNIX_TIMESTAMP(CURRENT_DATE)) )

if this is true then how can I subtract (- INTERVAL '1' MINUTE)?

Upvotes: 0

Views: 213

Answers (1)

eshirvana
eshirvana

Reputation: 24568

If you are using version 1.2 or later you can use this command:

CURRENT_DATE - INTERVAL '1' MINUTE

Upvotes: 1

Related Questions