使用python/thrift接口,我试图插入一个超级列,就像WTF is a Supercolumn..中的注释示例一样
我已经创建了超级列,并发现应该使用batch mutate来插入它。但我不知道如何创建突变,以及如何设置键和超级列类型
keyspace = "Keyspace1"
col1 = Column(name = "commenter", value = "J Doe", timestamp = time.time())
col2 = Column(name = "email", value = "jdoe@example.com", timestamp = time.time())
sc = SuperColumn(name = str(uuid.uuidl()), [col1, col2])
# i am guessing the missing code goes here
mutation = Mutation(column_or_supercolumn = sc?)
client.batch_mutate(keyspace, mutation, ConsistencyLevel.ZERO)
我会用pycassa之类的东西来让生活更轻松,但是像:
相关问题 更多 >
编程相关推荐