Skip to content

Instantly share code, notes, and snippets.

@tgruben
Created October 16, 2014 20:21
Show Gist options
  • Save tgruben/7b76a3e4757909ea5038 to your computer and use it in GitHub Desktop.
Save tgruben/7b76a3e4757909ea5038 to your computer and use it in GitHub Desktop.
go issue ported to python
from cassandra.cluster import Cluster
cluster = Cluster()
session = cluster.connect('hotbox')
stmt = session.prepare('INSERT INTO bitmap2 ( bitmap_id, block) VALUES (?,?);')
session.execute('truncate bitmap2')
out = open("/tmp/cass_py","w")
for ids in range(32):
val=0
for i in range(0,64):
b = 1 << i
val |=b
if i==63:
val=-1
out.write( "%d %d\n"%(ids,val))
session.execute(stmt,(ids,val))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment