Skip to content

Commit

Permalink
Additional script and experiment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Nov 6, 2023
1 parent f7e834c commit 619758e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
6 changes: 4 additions & 2 deletions experiments/15-e2e-scenarios-v2/motivation/COND
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ run_command(
name="set_up_router_before",
run="python3 set_up_router.py",
options={
"config-file": "config/config_large_100.yml",
"config-file": "../../../config/config_large_100.yml",
"schema-name": "imdb_extended_100g",
"query-bank-file": "queries.sql",
"redshift-queries": ",".join(map(str, range(0, 20))),
Expand All @@ -61,10 +61,12 @@ run_command(
name="set_up_router_after",
run="python3 set_up_router.py",
options={
"config-file": "config/config_large_100.yml",
"config-file": "../../../config/config_large_100.yml",
"schema-name": "imdb_extended_100g",
"query-bank-file": "queries.sql",
"aurora-queries": ",".join(map(str, range(0, 15))),
"athena-queries": ",".join(map(str, range(15, 20))),
},
# Prevents this task from running before `:brad_100g_before` completes.
deps=[":brad_100g_before"]
)
25 changes: 13 additions & 12 deletions experiments/15-e2e-scenarios-v2/motivation/set_up_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ async def run_transition(


def main():
set_up_logging(debug_mode=args.debug)
parser = argparse.ArgumentParser()
parser.add_argument(
"--config-file",
Expand All @@ -60,6 +59,7 @@ def main():
"--redshift-queries", type=str, help="Comma separated list of indices."
)
args = parser.parse_args()
set_up_logging()

# 1. Load the config.
config = ConfigFile.load(args.config_file)
Expand All @@ -81,17 +81,18 @@ def main():

# 4. Create the fixed routing policy.
query_map = {}
for qidx_str in args.athena_queries.split(","):
qidx = int(qidx_str.strip())
query_map[queries[qidx]] = Engine.Athena

for qidx_str in args.redshift_queries.split(","):
qidx = int(qidx_str.strip())
query_map[queries[qidx]] = Engine.Redshift

for qidx_str in args.aurora_queries.split(","):
qidx = int(qidx_str.strip())
query_map[queries[qidx]] = Engine.Aurora
if args.athena_queries is not None:
for qidx_str in args.athena_queries.split(","):
qidx = int(qidx_str.strip())
query_map[queries[qidx]] = Engine.Athena
if args.redshift_queries is not None:
for qidx_str in args.redshift_queries.split(","):
qidx = int(qidx_str.strip())
query_map[queries[qidx]] = Engine.Redshift
if args.aurora_queries is not None:
for qidx_str in args.aurora_queries.split(","):
qidx = int(qidx_str.strip())
query_map[queries[qidx]] = Engine.Aurora
clp = CachedLocationPolicy(query_map)

# 5. Replace the policy.
Expand Down

0 comments on commit 619758e

Please sign in to comment.