antithesis: Add CREATE TABLE parallel driver

This commit is contained in:
Pekka Enberg
2025-07-21 13:08:14 +03:00
parent 9788a8739c
commit bd30cb313c
10 changed files with 236 additions and 41 deletions

View File

@@ -15,9 +15,16 @@ except Exception as e:
cur_init = con_init.cursor()
tbl_len = cur_init.execute("SELECT count FROM tables").fetchone()[0]
selected_tbl = get_random() % tbl_len
tbl_schema = json.loads(cur_init.execute(f"SELECT schema FROM schemas WHERE tbl = {selected_tbl}").fetchone()[0])
# Get all existing tables from schemas
existing_schemas = cur_init.execute("SELECT tbl, schema FROM schemas").fetchall()
if not existing_schemas:
print("No tables found in schemas")
exit(0)
# Select a random table
selected_idx = get_random() % len(existing_schemas)
selected_tbl, schema_json = existing_schemas[selected_idx]
tbl_schema = json.loads(schema_json)
cols = ", ".join([f"col_{col}" for col in range(tbl_schema["colCount"])])
try: