Tuesday, February 12, 2013

getting the current time in hadoop-hive

As I keep forgetting how to do this:

from_unixtime(unix_timestamp())
will give you the current time in a query


to get year:weeknumber:
select concat(year(from_unixtime(unix_timestamp())), ":", weekofyear(from_unixtime(unix_timestamp())) from <tablename>