Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B889B774 for ; Fri, 22 Apr 2011 12:06:48 +0000 (UTC) Received: (qmail 28105 invoked by uid 500); 22 Apr 2011 12:06:48 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 28085 invoked by uid 500); 22 Apr 2011 12:06:48 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 28077 invoked by uid 99); 22 Apr 2011 12:06:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Apr 2011 12:06:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Apr 2011 12:06:44 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id CF023AD1D7 for ; Fri, 22 Apr 2011 12:06:05 +0000 (UTC) Date: Fri, 22 Apr 2011 12:06:05 +0000 (UTC) From: "Timu Eren (JIRA)" To: commits@cassandra.apache.org Message-ID: <893884131.76353.1303473965844.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <369801932.76351.1303473725771.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CASSANDRA-2542) InvalidRequestException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CASSANDRA-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Timu Eren updated CASSANDRA-2542: --------------------------------- Description: i got InvalidRequestException when execute map reduce jobs on supercolumn, if i set the comparator as LongType, other types (AsciiType, UTF8Type, IntegerType) works just fine Here is reprocedure details. create column family SuperTest with column_type=Super and comparator=LongType and subcomparator=UTF8Type and default_validation_class=UTF8Type; list SuperTest; Using default limit of 100 ------------------- RowKey: 2 => (super_column=10, (column=1, value=1, timestamp=1303459440853000)) => (super_column=11, (column=1, value=1, timestamp=1303459437632000)) => (super_column=12, (column=1, value=1, timestamp=1303459432652000)) => (super_column=13, (column=1, value=1, timestamp=1303459435102000)) ------------------- RowKey: 1 => (super_column=10, (column=1, value=1, timestamp=1303459423202000)) => (super_column=11, (column=1, value=1, timestamp=1303459419112000)) => (super_column=12, (column=deneme, value=1, timestamp=1303459362702000)) => (super_column=13, (column=deneme, value=1, timestamp=1303459382023000)) => (super_column=15, (column=1, value=1, timestamp=1303459426402000)) 2 Rows Returned. == Test class == import java.io.IOException; import java.nio.ByteBuffer; import java.util.List; import java.util.SortedMap; import org.apache.cassandra.hadoop.ColumnFamilyInputFormat; import org.apache.cassandra.hadoop.ColumnFamilyOutputFormat; import org.apache.cassandra.hadoop.ConfigHelper; import org.apache.cassandra.avro.Mutation; import org.apache.cassandra.thrift.SliceRange; import org.apache.cassandra.thrift.SlicePredicate; import org.apache.cassandra.utils.ByteBufferUtil; import org.apache.cassandra.db.IColumn; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Reducer; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; class SuperColumnTest extends Configured implements Tool { private static final Logger logger = LoggerFactory.getLogger(SuperColumnTest.class); public static void main(String[] args) throws Exception { ToolRunner.run(new Configuration(), new SuperColumnTest(), args); System.exit(0); } public static class SuperColumnTestMapper extends Mapper, Text, IntWritable> { private static final Logger logger = LoggerFactory.getLogger(SuperColumnTestMapper.class); public void map(ByteBuffer key, SortedMap columns, Context context) throws IOException, InterruptedException { logger.info(String.format("Key:%s, size: %s", ByteBufferUtil.string(key), columns.size())); } } public static class SuperColumnTestReducer extends Reducer> { public void reduce(Text key, Iterable values, Context context) throws IOException, InterruptedException { } } public int run(String[] args) throws Exception{ Job job = new Job(this.getConf(), "SuperColumnMapReduceTest"); job.setJarByClass(SuperColumnTest.class); job.setMapperClass(SuperColumnTestMapper.class); job.setReducerClass(SuperColumnTestReducer.class); job.setOutputFormatClass(ColumnFamilyOutputFormat.class); ConfigHelper.setOutputColumnFamily(job.getConfiguration(), "xxxx", "SuperTest"); job.setMapOutputKeyClass(Text.class); job.setMapOutputValueClass(IntWritable.class); job.setOutputKeyClass(ByteBuffer.class); job.setOutputValueClass(List.class); job.setInputFormatClass(ColumnFamilyInputFormat.class); ConfigHelper.setInputColumnFamily(job.getConfiguration(), "xxxx", "SuperTest"); ConfigHelper.setRpcPort(job.getConfiguration(), "9160"); ConfigHelper.setInitialAddress(job.getConfiguration(), "xxxx"); ConfigHelper.setPartitioner(job.getConfiguration(), "org.apache.cassandra.dht.RandomPartitioner"); SlicePredicate sp =new SlicePredicate(); ByteBuffer startKey = ByteBuffer.wrap("".getBytes()); ByteBuffer endKey = ByteBuffer.wrap("".getBytes()); SliceRange range = new SliceRange(); range.setStart(startKey); range.setFinish(endKey); range.setCount(Integer.MAX_VALUE); sp.setSlice_range(range); ConfigHelper.setInputSlicePredicate(job.getConfiguration(), sp); Long start = System.currentTimeMillis(); job.waitForCompletion(true); logger.info(String.format("Job Finished in " + (System.currentTimeMillis() - start) / 1000.0 + " seconds")); return 0; } } java.lang.RuntimeException: InvalidRequestException(why:Expected 8 or 0 byte long (2)) at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.maybeInit(ColumnFamilyRecordReader.java:260) at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.computeNext(ColumnFamilyRecordReader.java:275) at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.computeNext(ColumnFamilyRecordReader.java:172) at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:136) at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:131) at org.apache.cassandra.hadoop.ColumnFamilyRecordReader.nextKeyValue(ColumnFamilyRecordReader.java:131) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:423) at org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305) at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:177) Caused by: InvalidRequestException(why:Expected 8 or 0 byte long (2)) at org.apache.cassandra.thrift.Cassandra$get_range_slices_result.read(Cassandra.java:12088) at org.apache.cassandra.thrift.Cassandra$Client.recv_get_range_slices(Cassandra.java:732) at org.apache.cassandra.thrift.Cassandra$Client.get_range_slices(Cassandra.java:704) at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.maybeInit(ColumnFamilyRecordReader.java:238) ... 11 more was: i got InvalidRequestException when execute map reduce jobs on supercolumn, if i set the comparator as LongType, other types (AsciiType, UTF8Type, IntegerType) works just fine > InvalidRequestException > ----------------------- > > Key: CASSANDRA-2542 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2542 > Project: Cassandra > Issue Type: Bug > Components: Core > Affects Versions: 0.7.4 > Reporter: Timu Eren > Priority: Minor > > i got InvalidRequestException when execute map reduce jobs on supercolumn, if i set the comparator as LongType, other types (AsciiType, UTF8Type, IntegerType) works just fine > Here is reprocedure details. > create column family > SuperTest > with > column_type=Super and > comparator=LongType and > subcomparator=UTF8Type and > default_validation_class=UTF8Type; > list SuperTest; > Using default limit of 100 > ------------------- > RowKey: 2 > => (super_column=10, > (column=1, value=1, timestamp=1303459440853000)) > => (super_column=11, > (column=1, value=1, timestamp=1303459437632000)) > => (super_column=12, > (column=1, value=1, timestamp=1303459432652000)) > => (super_column=13, > (column=1, value=1, timestamp=1303459435102000)) > ------------------- > RowKey: 1 > => (super_column=10, > (column=1, value=1, timestamp=1303459423202000)) > => (super_column=11, > (column=1, value=1, timestamp=1303459419112000)) > => (super_column=12, > (column=deneme, value=1, timestamp=1303459362702000)) > => (super_column=13, > (column=deneme, value=1, timestamp=1303459382023000)) > => (super_column=15, > (column=1, value=1, timestamp=1303459426402000)) > 2 Rows Returned. > == Test class == > import java.io.IOException; > import java.nio.ByteBuffer; > import java.util.List; > import java.util.SortedMap; > import org.apache.cassandra.hadoop.ColumnFamilyInputFormat; > import org.apache.cassandra.hadoop.ColumnFamilyOutputFormat; > import org.apache.cassandra.hadoop.ConfigHelper; > import org.apache.cassandra.avro.Mutation; > import org.apache.cassandra.thrift.SliceRange; > import org.apache.cassandra.thrift.SlicePredicate; > import org.apache.cassandra.utils.ByteBufferUtil; > import org.apache.cassandra.db.IColumn; > import org.apache.hadoop.conf.Configuration; > import org.apache.hadoop.conf.Configured; > import org.apache.hadoop.io.IntWritable; > import org.apache.hadoop.io.Text; > import org.apache.hadoop.mapreduce.Job; > import org.apache.hadoop.mapreduce.Mapper; > import org.apache.hadoop.mapreduce.Reducer; > import org.apache.hadoop.util.Tool; > import org.apache.hadoop.util.ToolRunner; > import org.slf4j.Logger; > import org.slf4j.LoggerFactory; > class SuperColumnTest extends Configured implements Tool { > > private static final Logger logger = LoggerFactory.getLogger(SuperColumnTest.class); > > public static void main(String[] args) throws Exception { > ToolRunner.run(new Configuration(), new SuperColumnTest(), args); > System.exit(0); > } > > public static class SuperColumnTestMapper extends Mapper, Text, IntWritable> { > private static final Logger logger = LoggerFactory.getLogger(SuperColumnTestMapper.class); > > public void map(ByteBuffer key, SortedMap columns, Context context) throws IOException, InterruptedException { > > logger.info(String.format("Key:%s, size: %s", ByteBufferUtil.string(key), columns.size())); > > > } > } > > public static class SuperColumnTestReducer extends Reducer> { > public void reduce(Text key, Iterable values, Context context) throws IOException, InterruptedException { > > } > } > > public int run(String[] args) throws Exception{ > > Job job = new Job(this.getConf(), "SuperColumnMapReduceTest"); > job.setJarByClass(SuperColumnTest.class); > job.setMapperClass(SuperColumnTestMapper.class); > job.setReducerClass(SuperColumnTestReducer.class); > > > job.setOutputFormatClass(ColumnFamilyOutputFormat.class); > ConfigHelper.setOutputColumnFamily(job.getConfiguration(), "xxxx", "SuperTest"); > > job.setMapOutputKeyClass(Text.class); > job.setMapOutputValueClass(IntWritable.class); > > job.setOutputKeyClass(ByteBuffer.class); > job.setOutputValueClass(List.class); > job.setInputFormatClass(ColumnFamilyInputFormat.class); > > > ConfigHelper.setInputColumnFamily(job.getConfiguration(), "xxxx", "SuperTest"); > ConfigHelper.setRpcPort(job.getConfiguration(), "9160"); > ConfigHelper.setInitialAddress(job.getConfiguration(), "xxxx"); > ConfigHelper.setPartitioner(job.getConfiguration(), "org.apache.cassandra.dht.RandomPartitioner"); > > > > SlicePredicate sp =new SlicePredicate(); > > ByteBuffer startKey = ByteBuffer.wrap("".getBytes()); > ByteBuffer endKey = ByteBuffer.wrap("".getBytes()); > SliceRange range = new SliceRange(); > range.setStart(startKey); > range.setFinish(endKey); > range.setCount(Integer.MAX_VALUE); > > sp.setSlice_range(range); > > ConfigHelper.setInputSlicePredicate(job.getConfiguration(), sp); > > Long start = System.currentTimeMillis(); > job.waitForCompletion(true); > logger.info(String.format("Job Finished in " + (System.currentTimeMillis() - start) / 1000.0 + " seconds")); > > return 0; > } > } > java.lang.RuntimeException: InvalidRequestException(why:Expected 8 or 0 byte long (2)) > at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.maybeInit(ColumnFamilyRecordReader.java:260) > at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.computeNext(ColumnFamilyRecordReader.java:275) > at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.computeNext(ColumnFamilyRecordReader.java:172) > at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:136) > at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:131) > at org.apache.cassandra.hadoop.ColumnFamilyRecordReader.nextKeyValue(ColumnFamilyRecordReader.java:131) > at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:423) > at org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67) > at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143) > at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621) > at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305) > at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:177) > Caused by: InvalidRequestException(why:Expected 8 or 0 byte long (2)) > at org.apache.cassandra.thrift.Cassandra$get_range_slices_result.read(Cassandra.java:12088) > at org.apache.cassandra.thrift.Cassandra$Client.recv_get_range_slices(Cassandra.java:732) > at org.apache.cassandra.thrift.Cassandra$Client.get_range_slices(Cassandra.java:704) > at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.maybeInit(ColumnFamilyRecordReader.java:238) > ... 11 more -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira