Wednesday, 17 July 2013

python formating the current date/time

>>> import datetime
>>> datetime.datetime.now()
datetime.datetime(2013, 7, 16, 7, 12, 24, 491296)
>>> datetime.datetime.now().time()
datetime.time(7, 12, 45, 859333)
>>> str(datetime.datetime.now())
'2013-07-16 07:13:40.077304'


Monday, 15 July 2013

Drop all tables from Hive warehouse


Use it with caution, all tables will be droped. Non external tables' data will be lost.


hive -e 'show tables' | xargs -I '{}' hive -e 'drop table {}'