Skip to content

Commit bec89c7

Browse files
committed
Fixed param generation for query 3, query 11 and query 20
1 parent 0559167 commit bec89c7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

paramgenerator/generateparamsbi.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ def serialize_q2(country_sets, post_day_ranges):
131131
for country_set, count_country in country_sets:
132132
for day_range, count_post in post_day_ranges:
133133
if random.randint(0,len(country_sets) + len(post_day_ranges)) == 0:
134-
writer.append([str(day_range[0]), str(day_range[1]), ",".join(country_set), str(format_date(END_DATE))], [count_post,count_post,count_country,333])
134+
writer.append([str(day_range[0]), str(day_range[1]), ";".join(country_set), str(format_date(END_DATE))], [count_post,count_post,count_country,333])
135135

136136
def serialize_q3(post_months):
137-
writer = ParamsWriter("q3", ["todo1","todo2"])
137+
writer = ParamsWriter("q3", ["range1Start","range1End","range2Start","range2End"])
138138
for ix in range(0,len(post_months)):
139139
week_range_a, count_a = post_months[ix]
140140
for week_range_b, count_b in post_months[ix+1:]:
141-
writer.append([str(week_range_a),str(week_range_b)], [count_a,count_b])
141+
writer.append([str(week_range_a[0]),str(week_range_a[1]),str(week_range_b[0]),str(week_range_b[1])], [count_a,count_b])
142142

143143
def serialize_q4(tagclasses, countries):
144144
writer = ParamsWriter("q4", ["tagClass","country"])
@@ -179,6 +179,9 @@ def serialize_q10(tags):
179179
for tag, count in tags:
180180
writer.append([tag], [count])
181181

182+
def serialize_q11():
183+
writer = ParamsWriter("q11", ["country", "blacklist"])
184+
182185
def serialize_q12(post_weeks):
183186
writer = ParamsWriter("q12", ["creationDate", "likeCount"])
184187
for week, count in post_weeks:
@@ -222,6 +225,9 @@ def serialize_q19(tagclasses):
222225
for tag_class_b, count_b in tagclasses[ix+1:]:
223226
writer.append([str("1989-1-1"),tag_class_a, tag_class_b], [count_a, count_b])
224227

228+
def serialize_q20():
229+
writer = ParamsWriter("q20", [])
230+
225231
def serialize_q21(countries):
226232
writer = ParamsWriter("q21", ["country","endDate"])
227233
for country, count in countries:
@@ -346,5 +352,8 @@ def main(argv=None):
346352
serialize_q23(key_params(country_sample, total_posts/200, total_posts/100))
347353
serialize_q24(key_params(tagclass_posts, total_posts/140, total_posts/5))
348354

355+
serialize_q11()
356+
serialize_q20()
357+
349358
if __name__ == "__main__":
350359
sys.exit(main())

0 commit comments

Comments
 (0)