SQL to HiveQL in Hive Hadoop

540 views Asked by At

I am trying to write a HiveQL query which joins two data sets by a BAN column where one datasets timestamp is 72+ hours after the other datasets timestamp. I can write this in SQL but the syntax isn't the same in HiveQL. Can anyone help?

For example :

SELECT * FROM Session_Step_Table, Case_Table
WHERE Session_Step_Table.BAN = Case_Table.BAN AND
  DATEADD(hour, 72, Session_Step_Table.timestamp) <= Case_Table.timestamp
1

There are 1 answers

0
Ramzy On BEST ANSWER

I think you should use date_add() function provided in Hive. Look here