使用 Cassandra 1.2。我通过以下方式使用 CQL 3 创建了一个表:
CREATE TABLE foo (
user text PRIMARY KEY,
emails set<text>
);
现在我正在尝试通过pycassa查询数据:
import pycassa
from pycassa.pool import ConnectionPool
pool = ConnectionPool('ks1', ['localhost:9160'])
foo = pycassa.ColumnFamily(pool, 'foo')
这给了我
Traceback (most recent call last):
File "test.py", line 5, in <module>
foo = pycassa.ColumnFamily(pool, 'foo')
File "/home/john/src/pycassa/lib/python2.7/site-packages/pycassa/columnfamily.py", line 284, in __init__
self.load_schema()
File "/home/john/src/pycassa/lib/python2.7/site-packages/pycassa/columnfamily.py", line 312, in load_schema
raise nfe
pycassa.cassandra.ttypes.NotFoundException: NotFoundException(_message=None, why='Column family foo not found.')
如何实现?