Last active
November 18, 2020 22:14
-
-
Save tgrabiec/fb8ee3e3730a04666eedf6c46bc90b94 to your computer and use it in GitHub Desktop.
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
from cassandra.cluster import Cluster | |
import random | |
cluster = Cluster() | |
session = cluster.connect() | |
session.execute('drop keyspace ks') | |
session.execute("create keyspace ks WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1 };") | |
session.set_keyspace('ks') | |
prev = None | |
for i in range(468): | |
id = random.uniform(1, 100000) | |
print(i, id) | |
if prev: | |
session.execute('drop table ks.t%d' % prev) | |
session.execute('create table ks.t%d (p int primary key, r1 int, r2 int, r3 int, r4 int);' % id) | |
prev = id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment