1

I have a table in a database in hive. The table is partitioned based on year month and day.

My query looks something like this

select entity1,entity2
from table_t
  INNER JOIN tab_roll.cha alias2
  ON alias1.sid = alias2.sid

  INNER JOIN net_roll.net alias3
  ON alias2.id=alias3.id 
  where event= 'unknown' 
  and day >= 10 and day < 12
  and month >= 5 and month < 11
  and year = 2014

now I want to get results between say mm-dd-yyy HH : MM :SS and mm-dd-yyy HH : MM :SS, how should I do that?

Is is possible to have a pop up where the user chooses the date/time ranges?

Don't know if this helps but the data has about 500 million rows. Thanks

kRazzy R
  • 1,561
  • 1
  • 16
  • 44
  • in this case is it more time efficient to use `and day >= 10 and day < 12 and month >= 5 and month < 11 and year = 2014` or is using `month BETWEEN m1 and m2` etc more efficient in terms of speed of computation? – kRazzy R Oct 01 '15 at 21:39

1 Answers1

1

I think Between should work for you. & to optimize this you can index that column too.

Bhavesh Gadoya
  • 196
  • 2
  • 13