如何使用 Net::Cassandra::Easy 存储和检索 TimeUUIDType 类型?
执行以下操作:
my $c = Net::Cassandra::Easy->new(server => 'localhost', port => '9160', keyspace => 'Keyspace1'); $c->connect();
my $uuid_bin = Data::UUID->new()->create_bin();
eval { $result = $c->mutate([$key],
family => 'StandardByUUID1',
insertions => { $uuid_bin => '123' });
};
warn $@ if $@;
结果是:
Net::GenCassandra::InvalidRequestException
我没有看到任何类似于 UUID 的 Net::Cassandra::Easy::pack_decimal 的内容。
Doing the following:
my $c = Net::Cassandra::Easy->new(server => 'localhost', port => '9160', keyspace => 'Keyspace1'); $c->connect();
my $uuid_bin = Data::UUID->new()->create_bin();
eval { $result = $c->mutate([$key],
family => 'StandardByUUID1',
insertions => { $uuid_bin => '123' });
};
warn $@ if $@;
Result is a:
Net::GenCassandra::InvalidRequestException
I didn't see anything similar to Net::Cassandra::Easy::pack_decimal for UUIDs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许这里的Java代码会有用: http://wiki.apache.org/cassandra/FAQ #working_with_timeuuid_in_java
Perhaps the Java code here will be useful: http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java