1.Python脚本
# import datetime
tomorrow =args['tomorrow']
table = args['table']
for hh in range (0,24,1):
hh = str(hh).zfill(2) #位数不足前面补0
for mi in range (0,60,05):
mi = str(mi).zfill(2)
# print (tomorrow+hh+mi)
sql = 'alter table {} add if not exists partition (ds=\'{}\', hh=\'{}\',mm=\'{}\')'.format(table,tomorrow,hh,mi)
print (sql)
o.execute_sql(sql)