unconfigured columnfamily error on consecutive execute calls (CQL)

蹲街弑〆低调 提交于 2019-12-24 17:00:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!