问题
I'm using the cassandra python driver for datastax's distro. mah codez...
from cassandra.io.libevreactor import LibevConnection
from cassandra.cluster import Cluster
cluster = Cluster(['some ip addr'])
cluster.connection_class = LibevConnection
fails:
session = cluster.connect('demodb')
session.execute("INSERT INTO colFamName(attr1, attr2) VALUES ('123jkd', 'sdflkj')")
session.execute("SELECT attr1 FROM colFamName")
passes:
session = cluster.connect('demodb')
session.execute("INSERT INTO colFamName(attr1, attr2) VALUES ('123jkd', 'sdflkj')")
session.set_keyspace('demodb')
session.execute("SELECT attr1 FROM colFamName")
error:
File "build/bdist.linux-x86_64/egg/cassandra/cluster.py", line 995, in execute
File "build/bdist.linux-x86_64/egg/cassandra/cluster.py", line 2195, in result
cassandra.InvalidRequest: code=2200 [Invalid query] message="unconfigured columnfamily <my_columnfamily_name>"
consecutive session.execute calls work as long as I have 'reset' the keyspace since the last session.execute call. I should not have to reset this after every session.execute call.
thoughts? (I have already filed an issue in github, and will update when I get a response)
来源:https://stackoverflow.com/questions/22084257/unconfigured-columnfamily-error-on-consecutive-execute-calls-cql