我尝试插入带有UUID1键的列,以便能够按日期对它们进行排序。我总是犯错误”cassandra.ttypes.InvalidRequestException:InvalidRequestException(why='UUIDs must exactly 16 bytes')”,我不知道为什么。在
以下是生成此错误的代码:
from lazyboy import *
from lazyboy.key import Key
import uuid
class TestItemKey(Key):
def __init__(self, key=None):
Key.__init__(self, 'MXstore', 'TestCF', key)
class TestItem(record.Record):
def __init__(self, *args, **kwargs):
record.Record.__init__(self, *args, **kwargs)
self.key = TestItemKey(uuid.uuid1().bytes)
connection.add_pool('MXstore', ['localhost:9160'])
tmp = {'foo' : 'bar'}
tmps = TestItem(tmp).save()
我做错什么了?我用lazyboy 0.705和Cassandra 0.6.4。 存储配置为:
^{pr2}$
列名必须是uuid版本1。看起来你的密钥是uuid版本1
相关问题 更多 >
编程相关推荐