Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 27053C16C for ; Thu, 18 Jul 2013 15:29:12 +0000 (UTC) Received: (qmail 48624 invoked by uid 500); 18 Jul 2013 15:29:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 48603 invoked by uid 500); 18 Jul 2013 15:29:09 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 48577 invoked by uid 99); 18 Jul 2013 15:29:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 15:29:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mishra.vivs@gmail.com designates 74.125.83.47 as permitted sender) Received: from [74.125.83.47] (HELO mail-ee0-f47.google.com) (74.125.83.47) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 15:29:01 +0000 Received: by mail-ee0-f47.google.com with SMTP id e49so1783291eek.6 for ; Thu, 18 Jul 2013 08:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=JBuPIjOVWvikWn/59aMufnpZ9Ch5OL8oh+Vl/WlYItY=; b=GQIaGIeNWdnvAO5NRDVmHFxvgw9ZCd8n4cAOhgeZXnwxZrvvoJclM/uRsYTVcjw221 D2MMbF4YJ7LZRIPiyTwXSWUtqpfIjLcidsuqzzeybs1w6CX45M8TsEt6g7Gq16TjbrB1 nRlHm0IvJmaHncxAt8v9qIrvxAqbZFqqTtvH9RQwpprlT4BnD9ym27i6A/W5wR4RH2z4 t/LMHe3sZGGl0AcCkt8q+qpkX8f1fOtANmEjEdIaui+UCB/EeF5vjAUG6CNSv1xspx9o JRXDpAlShuH2weHsVjG2wo1FTopEaa8lDxnt18khLtlIXKcWXh1SOt86wPa07CT1BgUJ XMeg== MIME-Version: 1.0 X-Received: by 10.15.54.198 with SMTP id t46mr11901471eew.74.1374161320379; Thu, 18 Jul 2013 08:28:40 -0700 (PDT) Received: by 10.223.144.73 with HTTP; Thu, 18 Jul 2013 08:28:40 -0700 (PDT) In-Reply-To: References: Date: Thu, 18 Jul 2013 20:58:40 +0530 Message-ID: Subject: Re: Exception while writing compsite column names From: Vivek Mishra To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=001a11c3f8f85db3eb04e1cadd87 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3f8f85db3eb04e1cadd87 Content-Type: text/plain; charset=ISO-8859-1 Looks like validation class for composite column value is different than UTF8Type? Though code suggests it is: composite.addComponent("TEXT1", StringSerializer.get()); Please validate. -Vivek On Thu, Jul 18, 2013 at 7:41 PM, wrote: > Hi > > > > I have an issue while inserting a composite column name to one of the > Cassandra column families. Below is a detailed description of what I had > done and stuck up at. > > Please let me know where I had went wrong. > > > > Requirement: > > ------------------ > > Rowkey -> RowIdString > > Column name -> TEXT1 : value1 : TEXT2 : value2 : TEXT3 > > Column value -> value3 > > > > Column family definition: > > ------------------------------- > > create column family CompositeColumnNameTest > > WITH > comparator='CompositeType(UTF8Type,UTF8Type,UTF8Type,UTF8Type,UTF8Type)' > > AND key_validation_class=UTF8Type > > WITH compression_options={sstable_compression:SnappyCompressor, > chunk_length_kb:64}; > > > > Code: > > -------- > > String RowIdString = "1234"; > > > > Composite composite = new Composite(); > > composite.addComponent("TEXT1", StringSerializer.get()); > > composite.addComponent("value1", StringSerializer.get()); > > composite.addComponent("TEXT2", StringSerializer.get()); > > composite.addComponent("value3", StringSerializer.get()); > > composite.addComponent("TEXT3", StringSerializer.get()); > > > > Column column = new Column(composite.serialize()); > > column.setValue("value3".getBytes()); > > column.setTimestamp(System.currentTimeMillis()); > > > > // push data to cassandra > > batchMutate.addInsertion(RowIdString, "CompositeColumnNameTest", > column); > > keyspaceServiceImpl.batchMutate(batchMutate); > > > > Exception: > > ------------- > > me.prettyprint.hector.api.exceptions.HInvalidRequestException: > InvalidRequestException(why:Not enough bytes to read value of component 0) > > at > me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate(ExceptionsTranslatorImpl.java:45) > > at > me.prettyprint.cassandra.service.KeyspaceServiceImpl$1.execute(KeyspaceServiceImpl.java:97) > > at > me.prettyprint.cassandra.service.KeyspaceServiceImpl$1.execute(KeyspaceServiceImpl.java:90) > > at > me.prettyprint.cassandra.service.Operation.executeAndSetResult(Operation.java:103) > > at > me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:258) > > at > me.prettyprint.cassandra.service.KeyspaceServiceImpl.operateWithFailover(KeyspaceServiceImpl.java:131) > > > > > > Thanks in advance > > -Anand > > ------------------------------ > > The information in this Internet Email is confidential and may be legally > privileged. It is intended solely for the addressee. Access to this Email > by anyone else is unauthorized. If you are not the intended recipient, any > disclosure, copying, distribution or any action taken or omitted to be > taken in reliance on it, is prohibited and may be unlawful. When addressed > to our clients any opinions or advice contained in this Email are subject > to the terms and conditions expressed in any applicable governing The Home > Depot terms of business or client engagement letter. The Home Depot > disclaims all responsibility and liability for the accuracy and content of > this attachment and for any damages or losses arising from any > inaccuracies, errors, viruses, e.g., worms, trojan horses, etc., or other > items of a destructive nature, which may be contained in this attachment > and shall not be liable for direct, indirect, consequential or special > damages in connection with this e-mail message or its attachment. > --001a11c3f8f85db3eb04e1cadd87 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Looks like validation class for composite column value is = different than UTF8Type? Though code suggests it is:
=A0 =A0 =A0 =A0composite.addComponent(&qu= ot;TEXT1", = StringSerializer.get());

<= /div>
Please = validate.

-Vivek


On Thu, Jul 18, 2013 at 7:41 PM, <ANAND_BALARAMA= N@homedepot.com> wrote:

Hi

=A0

I have an issue while inserting a composite column n= ame to one of the Cassandra column families. Below is a detailed descriptio= n of what I had done and stuck up at.

Please let me know where I had went wrong.

=A0

Requirement:

------------------

=A0=A0=A0=A0=A0=A0 Rowkey =A0=A0=A0=A0=A0=A0 ->=A0=A0=A0=A0 RowIdStrin= g

=A0=A0=A0=A0=A0=A0 Column name=A0=A0 ->=A0=A0=A0=A0 TEXT1 : value1 : T= EXT2 : value2 : TEXT3

=A0=A0=A0=A0=A0=A0 Column value ->=A0=A0=A0=A0 value3

=A0

Column family definition:

-------------------------------

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 create column family CompositeColumnNameTest

=A0=A0=A0=A0=A0=A0 WITH comparator=3D'CompositeType(UTF8Type,UTF8Type= ,UTF8Type,UTF8Type,UTF8Type)'

=A0=A0=A0=A0=A0=A0 AND key_validation_class=3DUTF8Type

=A0=A0=A0=A0=A0=A0 WITH compression_options=3D{sstable_compression:Snappy= Compressor, chunk_length_kb:64};

=A0

Code:

--------

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 String RowIdString =3D "1234";

=A0

=A0=A0=A0=A0=A0=A0 Composite composite =3D new Composite();

=A0=A0=A0=A0=A0=A0 composite.addComponent("TEXT1", StringSerial= izer.get());

=A0=A0=A0=A0=A0=A0 composite.addComponent("value1", StringSeria= lizer.get());

=A0=A0=A0=A0=A0=A0 composite.addComponent("TEXT2", StringSerial= izer.get());

=A0=A0=A0=A0=A0=A0 composite.addComponent("value3", StringSeria= lizer.get());

=A0=A0=A0=A0=A0=A0 composite.addComponent("TEXT3", StringSerial= izer.get());

=A0=A0=A0=A0=A0=A0

=A0=A0=A0=A0=A0=A0 Column column =3D new Column(composite.serialize());

=A0=A0=A0=A0=A0=A0 column.setValue("value3".getBytes());=

=A0=A0=A0=A0=A0=A0 column.setTimestamp(System.currentTimeMillis());

=A0=A0=A0=A0=A0=A0

=A0=A0=A0=A0=A0=A0 // push data to cassandra

=A0=A0=A0=A0=A0=A0 batchMutate.addInsertion(RowIdString, "CompositeC= olumnNameTest", column);

=A0=A0=A0=A0=A0=A0 keyspaceServiceImpl.batchMutate(batchMutate);

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0

Exception:

-------------

me.prettyprint.hector.api.exceptions.HInvalidRequestException: InvalidReq= uestException(why:Not enough bytes to read value of component 0)

=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.ExceptionsTranslat= orImpl.translate(ExceptionsTranslatorImpl.java:45)

=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.KeyspaceServiceImp= l$1.execute(KeyspaceServiceImpl.java:97)

=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.KeyspaceServiceImp= l$1.execute(KeyspaceServiceImpl.java:90)

=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.Operation.executeA= ndSetResult(Operation.java:103)

=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.connection.HConnectionMana= ger.operateWithFailover(HConnectionManager.java:258)

=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.KeyspaceServiceImp= l.operateWithFailover(KeyspaceServiceImpl.java:131)

=A0

=A0

Thanks in advance

-Anand




The information in this Internet Email is confidential and may be legally p= rivileged. It is intended solely for the addressee. Access to this Email by= anyone else is unauthorized. If you are not the intended recipient, any di= sclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibite= d and may be unlawful. When addressed to our clients any opinions or advice= contained in this Email are subject to the terms and conditions expressed = in any applicable governing The Home Depot terms of business or client engagement letter. The Home Depot d= isclaims all responsibility and liability for the accuracy and content of t= his attachment and for any damages or losses arising from any inaccuracies,= errors, viruses, e.g., worms, trojan horses, etc., or other items of a destructive nature, which may be contain= ed in this attachment and shall not be liable for direct, indirect, consequ= ential or special damages in connection with this e-mail message or its att= achment.

--001a11c3f8f85db3eb04e1cadd87--