Skip to content

Instantly share code, notes, and snippets.

@reddikih
Created December 12, 2017 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reddikih/88e75ad0e9008f2937486a809751bc7a to your computer and use it in GitHub Desktop.
Save reddikih/88e75ad0e9008f2937486a809751bc7a to your computer and use it in GitHub Desktop.
#!/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