【问题标题】: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 
    

    【讨论】:

      猜你喜欢
      • 2015-05-21
      • 2015-05-24
      • 2016-01-04
      • 1970-01-01
      • 2014-03-27
      • 2016-06-28
      • 2016-08-11
      • 2020-08-02
      • 2017-03-04
      相关资源
      最近更新 更多