Last active
August 29, 2015 14:05
-
-
Save stefanooldeman/b977501a3f2dde8d6afe to your computer and use it in GitHub Desktop.
generate partitions (manual patch)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
days = range(16,30) # the days of the month= | |
p = "ALTER TABLE set_videoads_valid ADD IF NOT EXISTS PARTITION (year={year:d}, month={month:d}, day={day:d}, hour={hour:d}) LOCATION 'hdfs://spil-hadoop/datain/set/portal/valid/year={year:04d}/month={month:02d}/day={day:02d}/hour={hour:02d}'; " | |
print "USE datain; " | |
for x in days: | |
for h in range(0,24): | |
print p.format(year=2014, month=7, day=x, hour=h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment