【问题标题】:Reading timeuuid value from Cassandra - Using DataStax connector从 Cassandra 读取 timeuuid 值 - 使用 DataStax 连接器
【发布时间】:2017-10-07 00:51:09
【问题描述】:
我正在使用datastax 3.2.0 连接器。
当我尝试读取数据类型为timeuuid 的列时,出现以下错误。
Exception in thread "main"
com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timeuuid <-> java.lang.String]
我该如何解决这个问题?
【问题讨论】:
标签:
java
cassandra
datastax
【解决方案1】:
您正在尝试将字符串插入 timeuuid 字段。
在插入之前将字符串转换为uuid
String your_string = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
UUID uid = UUID.fromString(your_string); //Use this uid to insert