呵呵, 我正在使用
cf.insert(uuid.uuid1().bytes_le, {'column1': 'val1'})
(pycassa)
为 Cassandra 创建 TimeUUID,但出现错误
InvalidRequestException:
InvalidRequestException(why='UUIDs must be exactly 16 bytes')
它不适用于
uuid.uuid1()
uuid.uuid1().bytes
str(uuid.uuid1())
要么。
创建有效 TimeUUID 以与 CompareWith="TimeUUIDType"标志一起使用的最佳方法是什么?
谢谢,
亨里克
最佳答案
看起来您正在使用 uuid 作为行键而不是列名。
“compare_with: TimeUUIDType”属性指定列名将与使用 TimeUUIDType 进行比较,即 tells Cassandra how to sort the columns for slicing operations
您是否考虑过使用任何高级 Python 客户端?例如。 Tradedgy , Lazy Boy , Telephus或 Pycassa
关于python - 在 Python 中为 Cassandra 生成 UUID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3240267/