Created
December 12, 2017 07:27
-
-
Save reddikih/88e75ad0e9008f2937486a809751bc7a 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
#!/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