You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Emīls Šolmanis <em...@gmail.com> on 2016/03/09 20:52:46 UTC

Exception about too long clustering key

Hello,

I keep getting an exception about a clustering key being too long, like

com.datastax.driver.core.exceptions.InvalidQueryException: The sum of
all clustering columns is too long (72650 > 65535)
	at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)


But the table has no clustering key. Even if I set the clustering key to a
single column that's guaranteed to be a string around 4-5 characters, I get
the same thing.

The only result Google gave me suggested this was about the clustering key
names, so I renamed all the fields in the schema def to 1-3 letters, to no
avail.

Does anyone know what this is about and how I can solve this?

Running Cassandra 2.2.4, Datastax driver 3.0.0.

Regards,
Emils

Re: Exception about too long clustering key

Posted by Jack Krupansky <ja...@gmail.com>.
The offending code (limit check and exception with that message) went away
with the merge of the so-called "Storage engine refactor, a.k.a
CASSANDRA-8099" changes from September 1, 2014 that got merged on June 30,
2015. Github doesn't seem to have a way to search old versions of the repo.
Interesting. I mean, I wanted to search through the code as of the tag for
2.2.4. You would have to actually check out the code from that tag and then
search in an IDE.

-- Jack Krupansky

On Thu, Mar 10, 2016 at 3:53 PM, Emīls Šolmanis <em...@gmail.com>
wrote:

>
> Jack
>
> Yeah, I tracked it down to
>
>
> https://github.com/apache/cassandra/blob/cassandra-2.2.4/src/java/org/apache/cassandra/cql3/QueryProcessor.java#L213
>
> But it's actually to do with how the cell names are being constructed for
> collections somehow. The offender was a set<rather-big-UDT>, but I solved
> it by backtracking from that function and reading the JavaDocs on the
> `CellName` and `Composite` interfaces involved, particularly
>
>
> https://github.com/apache/cassandra/blob/cassandra-2.2.4/src%2Fjava%2Forg%2Fapache%2Fcassandra%2Fdb%2Fcomposites%2FCellName.java#L38
>
> I didn't dig much further, since a simple A/B test of the mapped object
> going into Cassandra once I removed the collection in question proved my
> hypothesis.
>
> On Thu, 10 Mar 2016 at 20:15 Jack Krupansky <ja...@gmail.com>
> wrote:
>
>> Did you ever find the source of the message? I couldn't find it in github
>> either, either in the driver or Cassandra proper.
>>
>> -- Jack Krupansky
>>
>> On Thu, Mar 10, 2016 at 12:39 PM, Emīls Šolmanis <
>> emils.solmanis@gmail.com> wrote:
>>
>>> In case someone stumbles upon this same thing later.
>>>
>>> Ended up being a collection item that was too big (i.e., larger than
>>> 64K). Something to do with the way Cassandra generates the keys for
>>> collections, but moving the offending collection from a list<UDT> to a
>>> separate clustering key solved this particular instance. The error message
>>> could definitely be better though, and I'll raise it with the devs.
>>>
>>> Regards,
>>> Emils
>>>
>>> On Wed, 9 Mar 2016 at 20:31 Emīls Šolmanis <em...@gmail.com>
>>> wrote:
>>>
>>>> Hey Alex,
>>>>
>>>> I did do a grep for that message in the driver code base and it seems
>>>> like it's not there, so I think this is coming from the server.
>>>>
>>>> Only thing I can think of is us exceeding one of the limits (e.g., the
>>>> 65K collection item one) and then the error message being super misleading.
>>>> I'll check the server code tomorrow and see if I can track that message
>>>> down.
>>>>
>>>> Regards,
>>>> Emils
>>>>
>>>> On Wed, 9 Mar 2016 20:02 Alex Popescu, <al...@datastax.com> wrote:
>>>>
>>>>> Hi Emīls,
>>>>>
>>>>> Directing this question to the Java driver mailing list will give you
>>>>> better chances to get an answer:
>>>>> https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
>>>>>
>>>>> (as a side note, I haven't seen this one before)
>>>>>
>>>>> On Wed, Mar 9, 2016 at 11:52 AM, Emīls Šolmanis <
>>>>> emils.solmanis@gmail.com> wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I keep getting an exception about a clustering key being too long,
>>>>>> like
>>>>>>
>>>>>> com.datastax.driver.core.exceptions.InvalidQueryException: The sum of all clustering columns is too long (72650 > 65535)
>>>>>> 	at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
>>>>>> 	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
>>>>>> 	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
>>>>>>
>>>>>>
>>>>>> But the table has no clustering key. Even if I set the clustering key
>>>>>> to a single column that's guaranteed to be a string around 4-5 characters,
>>>>>> I get the same thing.
>>>>>>
>>>>>> The only result Google gave me suggested this was about the
>>>>>> clustering key names, so I renamed all the fields in the schema def to 1-3
>>>>>> letters, to no avail.
>>>>>>
>>>>>> Does anyone know what this is about and how I can solve this?
>>>>>>
>>>>>> Running Cassandra 2.2.4, Datastax driver 3.0.0.
>>>>>>
>>>>>> Regards,
>>>>>> Emils
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Bests,
>>>>>
>>>>> Alex Popescu | @al3xandru
>>>>> Sen. Product Manager @ DataStax
>>>>>
>>>>>
>>

Re: Exception about too long clustering key

Posted by Emīls Šolmanis <em...@gmail.com>.
Jack

Yeah, I tracked it down to

https://github.com/apache/cassandra/blob/cassandra-2.2.4/src/java/org/apache/cassandra/cql3/QueryProcessor.java#L213

But it's actually to do with how the cell names are being constructed for
collections somehow. The offender was a set<rather-big-UDT>, but I solved
it by backtracking from that function and reading the JavaDocs on the
`CellName` and `Composite` interfaces involved, particularly

https://github.com/apache/cassandra/blob/cassandra-2.2.4/src%2Fjava%2Forg%2Fapache%2Fcassandra%2Fdb%2Fcomposites%2FCellName.java#L38

I didn't dig much further, since a simple A/B test of the mapped object
going into Cassandra once I removed the collection in question proved my
hypothesis.

On Thu, 10 Mar 2016 at 20:15 Jack Krupansky <ja...@gmail.com>
wrote:

> Did you ever find the source of the message? I couldn't find it in github
> either, either in the driver or Cassandra proper.
>
> -- Jack Krupansky
>
> On Thu, Mar 10, 2016 at 12:39 PM, Emīls Šolmanis <emils.solmanis@gmail.com
> > wrote:
>
>> In case someone stumbles upon this same thing later.
>>
>> Ended up being a collection item that was too big (i.e., larger than
>> 64K). Something to do with the way Cassandra generates the keys for
>> collections, but moving the offending collection from a list<UDT> to a
>> separate clustering key solved this particular instance. The error message
>> could definitely be better though, and I'll raise it with the devs.
>>
>> Regards,
>> Emils
>>
>> On Wed, 9 Mar 2016 at 20:31 Emīls Šolmanis <em...@gmail.com>
>> wrote:
>>
>>> Hey Alex,
>>>
>>> I did do a grep for that message in the driver code base and it seems
>>> like it's not there, so I think this is coming from the server.
>>>
>>> Only thing I can think of is us exceeding one of the limits (e.g., the
>>> 65K collection item one) and then the error message being super misleading.
>>> I'll check the server code tomorrow and see if I can track that message
>>> down.
>>>
>>> Regards,
>>> Emils
>>>
>>> On Wed, 9 Mar 2016 20:02 Alex Popescu, <al...@datastax.com> wrote:
>>>
>>>> Hi Emīls,
>>>>
>>>> Directing this question to the Java driver mailing list will give you
>>>> better chances to get an answer:
>>>> https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
>>>>
>>>> (as a side note, I haven't seen this one before)
>>>>
>>>> On Wed, Mar 9, 2016 at 11:52 AM, Emīls Šolmanis <
>>>> emils.solmanis@gmail.com> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I keep getting an exception about a clustering key being too long, like
>>>>>
>>>>> com.datastax.driver.core.exceptions.InvalidQueryException: The sum of all clustering columns is too long (72650 > 65535)
>>>>> 	at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
>>>>> 	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
>>>>> 	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
>>>>>
>>>>>
>>>>> But the table has no clustering key. Even if I set the clustering key
>>>>> to a single column that's guaranteed to be a string around 4-5 characters,
>>>>> I get the same thing.
>>>>>
>>>>> The only result Google gave me suggested this was about the clustering
>>>>> key names, so I renamed all the fields in the schema def to 1-3 letters, to
>>>>> no avail.
>>>>>
>>>>> Does anyone know what this is about and how I can solve this?
>>>>>
>>>>> Running Cassandra 2.2.4, Datastax driver 3.0.0.
>>>>>
>>>>> Regards,
>>>>> Emils
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Bests,
>>>>
>>>> Alex Popescu | @al3xandru
>>>> Sen. Product Manager @ DataStax
>>>>
>>>>
>

Re: Exception about too long clustering key

Posted by Jack Krupansky <ja...@gmail.com>.
Did you ever find the source of the message? I couldn't find it in github
either, either in the driver or Cassandra proper.

-- Jack Krupansky

On Thu, Mar 10, 2016 at 12:39 PM, Emīls Šolmanis <em...@gmail.com>
wrote:

> In case someone stumbles upon this same thing later.
>
> Ended up being a collection item that was too big (i.e., larger than 64K).
> Something to do with the way Cassandra generates the keys for collections,
> but moving the offending collection from a list<UDT> to a separate
> clustering key solved this particular instance. The error message could
> definitely be better though, and I'll raise it with the devs.
>
> Regards,
> Emils
>
> On Wed, 9 Mar 2016 at 20:31 Emīls Šolmanis <em...@gmail.com>
> wrote:
>
>> Hey Alex,
>>
>> I did do a grep for that message in the driver code base and it seems
>> like it's not there, so I think this is coming from the server.
>>
>> Only thing I can think of is us exceeding one of the limits (e.g., the
>> 65K collection item one) and then the error message being super misleading.
>> I'll check the server code tomorrow and see if I can track that message
>> down.
>>
>> Regards,
>> Emils
>>
>> On Wed, 9 Mar 2016 20:02 Alex Popescu, <al...@datastax.com> wrote:
>>
>>> Hi Emīls,
>>>
>>> Directing this question to the Java driver mailing list will give you
>>> better chances to get an answer:
>>> https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
>>>
>>> (as a side note, I haven't seen this one before)
>>>
>>> On Wed, Mar 9, 2016 at 11:52 AM, Emīls Šolmanis <
>>> emils.solmanis@gmail.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> I keep getting an exception about a clustering key being too long, like
>>>>
>>>> com.datastax.driver.core.exceptions.InvalidQueryException: The sum of all clustering columns is too long (72650 > 65535)
>>>> 	at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
>>>> 	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
>>>> 	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
>>>>
>>>>
>>>> But the table has no clustering key. Even if I set the clustering key
>>>> to a single column that's guaranteed to be a string around 4-5 characters,
>>>> I get the same thing.
>>>>
>>>> The only result Google gave me suggested this was about the clustering
>>>> key names, so I renamed all the fields in the schema def to 1-3 letters, to
>>>> no avail.
>>>>
>>>> Does anyone know what this is about and how I can solve this?
>>>>
>>>> Running Cassandra 2.2.4, Datastax driver 3.0.0.
>>>>
>>>> Regards,
>>>> Emils
>>>>
>>>
>>>
>>>
>>> --
>>> Bests,
>>>
>>> Alex Popescu | @al3xandru
>>> Sen. Product Manager @ DataStax
>>>
>>>

Re: Exception about too long clustering key

Posted by Emīls Šolmanis <em...@gmail.com>.
In case someone stumbles upon this same thing later.

Ended up being a collection item that was too big (i.e., larger than 64K).
Something to do with the way Cassandra generates the keys for collections,
but moving the offending collection from a list<UDT> to a separate
clustering key solved this particular instance. The error message could
definitely be better though, and I'll raise it with the devs.

Regards,
Emils

On Wed, 9 Mar 2016 at 20:31 Emīls Šolmanis <em...@gmail.com> wrote:

> Hey Alex,
>
> I did do a grep for that message in the driver code base and it seems like
> it's not there, so I think this is coming from the server.
>
> Only thing I can think of is us exceeding one of the limits (e.g., the 65K
> collection item one) and then the error message being super misleading.
> I'll check the server code tomorrow and see if I can track that message
> down.
>
> Regards,
> Emils
>
> On Wed, 9 Mar 2016 20:02 Alex Popescu, <al...@datastax.com> wrote:
>
>> Hi Emīls,
>>
>> Directing this question to the Java driver mailing list will give you
>> better chances to get an answer:
>> https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
>>
>> (as a side note, I haven't seen this one before)
>>
>> On Wed, Mar 9, 2016 at 11:52 AM, Emīls Šolmanis <emils.solmanis@gmail.com
>> > wrote:
>>
>>> Hello,
>>>
>>> I keep getting an exception about a clustering key being too long, like
>>>
>>> com.datastax.driver.core.exceptions.InvalidQueryException: The sum of all clustering columns is too long (72650 > 65535)
>>> 	at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
>>> 	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
>>> 	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
>>>
>>>
>>> But the table has no clustering key. Even if I set the clustering key to
>>> a single column that's guaranteed to be a string around 4-5 characters, I
>>> get the same thing.
>>>
>>> The only result Google gave me suggested this was about the clustering
>>> key names, so I renamed all the fields in the schema def to 1-3 letters, to
>>> no avail.
>>>
>>> Does anyone know what this is about and how I can solve this?
>>>
>>> Running Cassandra 2.2.4, Datastax driver 3.0.0.
>>>
>>> Regards,
>>> Emils
>>>
>>
>>
>>
>> --
>> Bests,
>>
>> Alex Popescu | @al3xandru
>> Sen. Product Manager @ DataStax
>>
>>

Re: Exception about too long clustering key

Posted by Emīls Šolmanis <em...@gmail.com>.
Hey Alex,

I did do a grep for that message in the driver code base and it seems like
it's not there, so I think this is coming from the server.

Only thing I can think of is us exceeding one of the limits (e.g., the 65K
collection item one) and then the error message being super misleading.
I'll check the server code tomorrow and see if I can track that message
down.

Regards,
Emils

On Wed, 9 Mar 2016 20:02 Alex Popescu, <al...@datastax.com> wrote:

> Hi Emīls,
>
> Directing this question to the Java driver mailing list will give you
> better chances to get an answer:
> https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
>
> (as a side note, I haven't seen this one before)
>
> On Wed, Mar 9, 2016 at 11:52 AM, Emīls Šolmanis <em...@gmail.com>
> wrote:
>
>> Hello,
>>
>> I keep getting an exception about a clustering key being too long, like
>>
>> com.datastax.driver.core.exceptions.InvalidQueryException: The sum of all clustering columns is too long (72650 > 65535)
>> 	at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
>> 	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
>> 	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
>>
>>
>> But the table has no clustering key. Even if I set the clustering key to
>> a single column that's guaranteed to be a string around 4-5 characters, I
>> get the same thing.
>>
>> The only result Google gave me suggested this was about the clustering
>> key names, so I renamed all the fields in the schema def to 1-3 letters, to
>> no avail.
>>
>> Does anyone know what this is about and how I can solve this?
>>
>> Running Cassandra 2.2.4, Datastax driver 3.0.0.
>>
>> Regards,
>> Emils
>>
>
>
>
> --
> Bests,
>
> Alex Popescu | @al3xandru
> Sen. Product Manager @ DataStax
>
>

Re: Exception about too long clustering key

Posted by Alex Popescu <al...@datastax.com>.
Hi Emīls,

Directing this question to the Java driver mailing list will give you
better chances to get an answer:
https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user

(as a side note, I haven't seen this one before)

On Wed, Mar 9, 2016 at 11:52 AM, Emīls Šolmanis <em...@gmail.com>
wrote:

> Hello,
>
> I keep getting an exception about a clustering key being too long, like
>
> com.datastax.driver.core.exceptions.InvalidQueryException: The sum of all clustering columns is too long (72650 > 65535)
> 	at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
> 	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
> 	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
>
>
> But the table has no clustering key. Even if I set the clustering key to a
> single column that's guaranteed to be a string around 4-5 characters, I get
> the same thing.
>
> The only result Google gave me suggested this was about the clustering key
> names, so I renamed all the fields in the schema def to 1-3 letters, to no
> avail.
>
> Does anyone know what this is about and how I can solve this?
>
> Running Cassandra 2.2.4, Datastax driver 3.0.0.
>
> Regards,
> Emils
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax