Cassandra InvalidRequestException(为什么:[MyKeyspace] [MyColumnFamily] [6675 ... 6c74] = [6c86 ...... e65720]验证失败(String未验证。))

时间:2011-08-10 09:21:50

标签: java hadoop mapreduce cassandra

我正在使用Cassandra和Hadoop进行输入和输出。在输出减少作业期间,我收到错误:

2011-08-10 03:54:04,326 WARN org.apache.hadoop.mapred.Child: Error running child
java.io.IOException: InvalidRequestException(why:[MyKeyspace][MyColumnFamily][66756c6c74657874] = [6c696e6bb66e68656974207a756d.................65697465726520536f6e67746578746520] failed    validation (String didn't validate.))
at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:19045)
at org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:1035)
at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:1009)
at   org.apache.cassandra.hadoop.ColumnFamilyRecordWriter$RangeClient.run(ColumnFamilyRecordWriter.java:285)
2011-08-10 03:54:04,339 INFO org.apache.hadoop.mapred.Task: Runnning cleanup for the task
2011-08-10 03:54:04,340 WARN org.apache.hadoop.io.UTF8: truncating long string: 267364 chars, starting with java.io.IOException:

根据日志,这不是在开始时,而是在成功合并,排序和处理8981键之后。在8982年它失败了。

已在google和stackoverflow上搜索过,但未找到。

列族是这样的:

create column family MyColumnFamily with comparator = UTF8Type and                                                                                        
key_validation_class=UTF8Type and 
column_metadata = 
[
{column_name: column1, validation_class: UTF8Type, index_type: 0},
{column_name: column2, validation_class: UTF8Type, index_type: 0},
{column_name: column3, validation_class: UTF8Type, index_type: 0}
];

提前谢谢!

1 个答案:

答案 0 :(得分:7)

这意味着您的一个列值实际上不是有效的UTF8编码字符串。消息中的第一个十六进制字符串是以字节为单位的列名,第二个是无法解码的字节。