Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

im currently running a query in presto db which has a condition like below:

x.created_date > date_add('day',-15,y.arrival_timestamp )

I plan to move the query to hive and want to know what is the alternative to get the comparision to work exactly as above, when i run the query in Hive

Created_date sample value 2020-12-04T15:47:15.497000

arrival_timestamp sample value 2020-11-24T21:08:20.046000

Any help would be appreciated.Thank you


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
4.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

You can use date_sub in Hive:

x.created_date > date_sub(y.arrival_timestamp, 15)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...