Skip to content

Commit 12a9c97

Browse files
committed
[hbase] Smarted prefixing of column names with padding
1 parent b9c43b4 commit 12a9c97

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

hbase-tables/create_schemas.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
#
32
# Generates columns and cell data for an analytics tables of 1000+ columns
43
# cf. url
@@ -25,18 +24,18 @@ def columns_hours():
2524
FAMILLY = 'hour'
2625
cols = []
2726
for hour in HOURS:
28-
cols.append('%s:%s-%s' % (FAMILLY, hour, 'total'))
27+
cols.append('%s:%02d-%s' % (FAMILLY, hour, 'total'))
2928
for country in COUNTRIES:
30-
cols.append('%s:%s-%s' % (FAMILLY, hour, country))
29+
cols.append('%s:%02d-%s' % (FAMILLY, hour, country))
3130
return cols
3231

3332
def columns_days():
3433
FAMILLY = 'day'
3534
cols = []
3635
for day in DAYS:
37-
cols.append('%s:%s-%s' % (FAMILLY, day, 'total'))
36+
cols.append('%s:%03d-%s' % (FAMILLY, day, 'total'))
3837
for country in COUNTRIES:
39-
cols.append('%s:%s-%s' % (FAMILLY, day, country))
38+
cols.append('%s:%03d-%s' % (FAMILLY, day, country))
4039
return cols
4140

4241
def columns_total():

0 commit comments

Comments
 (0)