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 C6DC9C777 for ; Thu, 18 Jul 2013 17:24:03 +0000 (UTC) Received: (qmail 98397 invoked by uid 500); 18 Jul 2013 17:23:58 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 98386 invoked by uid 500); 18 Jul 2013 17:23:58 -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 97924 invoked by uid 99); 18 Jul 2013 17:23:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 17:23:57 +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 (nike.apache.org: domain of mishra.vivs@gmail.com designates 74.125.83.52 as permitted sender) Received: from [74.125.83.52] (HELO mail-ee0-f52.google.com) (74.125.83.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 17:23:50 +0000 Received: by mail-ee0-f52.google.com with SMTP id c50so1910080eek.11 for ; Thu, 18 Jul 2013 10:23:30 -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=rm4IHZ1wJHzt32PDorQYTzk+ds/pmhBxMXYL0NUlk6g=; b=tKcwjk7s7hEWG48YAsmfDHypszVFIhkJT5fvxmbeLziudMSLTYau7L/hSTK526W6/9 /xh+p34GKs970lE7AsGFJff7qCMB11B/CUHpbmZzqke1Sooo8hKfB8cSfPQiwKp732Vm FM0bYEqU5g0uLUUXLxf+y9RTHnDcrKXy59ttBd/+URTyRrjMtFYAjoc9tNaQZfRj6exL q2xorKJ7hdxouTfsHJWh7naGcHUUhZzF8YqJLVhAf+MbXtp0R9MD0HYwP0crF01Raytf aZrxi3/dZavJK7Lksky9wCeIcCHzcL4MsERm1wsjQ8oEpLQjdaQ/IHTljsiHW8mTyKT5 q0SQ== MIME-Version: 1.0 X-Received: by 10.14.182.132 with SMTP id o4mr12088859eem.94.1374168210676; Thu, 18 Jul 2013 10:23:30 -0700 (PDT) Received: by 10.223.144.73 with HTTP; Thu, 18 Jul 2013 10:23:30 -0700 (PDT) In-Reply-To: References: Date: Thu, 18 Jul 2013 22:53:30 +0530 Message-ID: Subject: Re: Exception while writing compsite column names From: Vivek Mishra To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b3a80160f4b0c04e1cc78fa X-Virus-Checked: Checked by ClamAV on apache.org --047d7b3a80160f4b0c04e1cc78fa Content-Type: text/plain; charset=ISO-8859-1 Yes. can you please share output of describe keyspace which contains " CompositeColumnNameTest" What is the datatype for column values? -Vive On Thu, Jul 18, 2013 at 9:17 PM, wrote: > I had been using the StringSerilaizer.get() for all UTF8Type fields so > far. Do not think I need to check the code. > > Do you suspect the column family definition? > > > > -Anand > > > > *From:* Vivek Mishra [mailto:mishra.vivs@gmail.com] > *Sent:* Thursday, July 18, 2013 11:29 AM > *To:* user@cassandra.apache.org > *Subject:* Re: Exception while writing compsite column names > > > > 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. > > > > ------------------------------ > > 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. > --047d7b3a80160f4b0c04e1cc78fa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Yes. can you please share output of describe keyspace whic= h contains "Compos= iteColumnNameTest"
What is the data= type for column values?

=
-Vive<= /span>


On Thu, Jul 18, 2013 at 9:17 PM, <ANAND_BALARAMAN@homedepot.c= om> wrote:

I had been using the Stri= ngSerilaizer.get() for all UTF8Type fields so far. Do not think I need to c= heck the code.

Do you suspect the column= family definition?

=A0

-Anand

=A0

From: Vivek Mi= shra [mailto:mis= hra.vivs@gmail.com]
Sent: Thursday, July 18, 2013 11:29 AM
To: u= ser@cassandra.apache.org
Subject: Re: Exception while writing compsite column names

=A0

Looks like validation class for composite column val= ue is different than UTF8Type? Though code suggests it is:

=A0 =A0 =A0 =A0composite.addComponent("TEXT1", StringSerializer= .get());

=A0

Please validate.

=A0

-Vivek

=A0

On Thu, Jul 18, 2013 at 7:41 PM, <ANAND_BALARAMAN@homedep= ot.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

=A0



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.

=A0




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.

--047d7b3a80160f4b0c04e1cc78fa--