Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python
# Usage:
# 1. install pip
#
# curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py";python get-pip.py
#
# 2. install cassandra driver via pip
#
# pip install cassandra-driver
#
# run this script
from cassandra.cluster import Cluster
from cassandra.query import *
from cassandra import *
import hashlib
import sys
KEYSPACE = 'orb_coin'
TABLE = 'tx_account'
BATCH_SIZE = 1000
cluster = Cluster()
session = cluster.connect(KEYSPACE)
def getIdAll():
query = session.prepare("select id from " + KEYSPACE + "." + TABLE)
rows = session.execute(query)
for r in rows:
print '"' + r.id + '"'
if __name__ == "__main__":
getIdAll()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment