cassandra - 未找到请求的操作的编解码器 : [list<watson. destination_intent> <-> scala.collection.immutable.$colon$colon]

标签 cassandra user-defined-types

尝试使用 UserDefinedType 列表时出现 CodecNotFoundException 我已经注册了 UDT 的编解码器,当我尝试使用 UDT 列表时会发生这种情况

com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [list<watson.destination_intent> <-> scala.collection.immutable.$colon$colon]
at com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:741)
at com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:602)
at com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:582)
at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:507)
at com.datastax.driver.core.AbstractGettableByIndexData.codecFor(AbstractGettableByIndexData.java:77)
at com.datastax.driver.core.BoundStatement.bind(BoundStatement.java:201)
at com.datastax.driver.core.DefaultPreparedStatement.bind(DefaultPreparedStatement.java:126)
at com.expedia.www.watson.flink.jobs.CassandraListOutputFormat.writeRecord(TravelerProfileLoadJob.scala:218)
at com.expedia.www.watson.flink.jobs.CassandraListOutputFormat.writeRecord(TravelerProfileLoadJob.scala:173)
at com.expedia.www.watson.sdk.flink.outputs.RateLimitingOutputFormat.writeRecord(RateLimitingOutputFormat.scala:36)
at org.apache.flink.runtime.operators.DataSinkTask.invoke(DataSinkTask.java:192)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:642)
at java.lang.Thread.run(Thread.java:745)

最佳答案

事实证明问题出在 scala 和 java 转换上。 由于驱动程序是用 java 编写的,并且我使用 scala 来传递列表,因此在尝试动态创建编解码器时失败了。 一旦我将列表更改为 java.util.list,它就开始工作。

关于cassandra - 未找到请求的操作的编解码器 : [list<watson. destination_intent> <-> scala.collection.immutable.$colon$colon],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43690428/

相关文章:

c# - Dapper:帮助我运行具有多个用户定义的表类型的存储过程

c# - 将 IEnumerable<string> 作为用户定义的表类型参数传递给 SQL Server 存储过程

sql - 如何在 TYPE OBJECT 的 VARRAY 中正确插入?

cassandra - 如何在 Cassandra 中对时间序列数据实现差异聚合/汇总

Cassandra - 日期早于 1970 年

cassandra - CQL3:只有主键时如何检索TTL?

sql-server-2014 - 在 SQL Server 2014 中找不到用户定义的数据类型 'empnum'

Cassandra Storm 集成

session - Cassandra V3 : repair thread hangs when running on multiple nodes