incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <moshe.kr...@barclays.com>
Subject RE: CQL vs. non-CQL data models
Date Tue, 02 Apr 2013 10:01:58 GMT
column family created using CQL is not visible via Cassandra CLI
            [default@test1] list employees1;
            employees1 not found in current keyspace.

CQL3 automatically down-cases all unquoted literals
You need to enclose any name with mixed case in quotes - see http://stackoverflow.com/questions/11726294/connectiong-to-cassandra-keyspace-created-in-cql-3


From: aaron morton [mailto:aaron@thelastpickle.com]
Sent: Thursday, March 28, 2013 4:42 AM
To: user@cassandra.apache.org
Subject: Re: CQL vs. non-CQL data models

Is this data model defined by Thrift? How closely does it reflect the
Cassandra internal data model?
Yes.
Astynax is a thrift based API, and the thrift model closely matches the internal model.
CQL 3 provides some abstractions on top of the internal model.

Is there any documentation or other online pointers describing these
different data models?
See data modelling http://www.datastax.com/docs

Can I use both access methods for a particular column family?
If is the CQL 3 table is created with COMPACT STORAGE

Can a column family that was created using CQL have columns added to
it dynamically?
It can have the schema updated without locking.
It cannot have new column names added on a per row basis, like the dynamic schema with the
thrift API.
However if you squint hard enough the Grouping Columns in the CREATE TABLE statement look
like they create new columns (they do internally).

Can I add CQL required metadata to column families created using
Cassandra CLI later, so that they can be accessed via CQL?
No

I'm trying to access data created using CQL by using non-CQL based
access methods and vice versa and I'm confused about the following
behaviour:
Unless you have a need for this I would avoid it.

- trying to use MutationBatch for modifying a rows in column family
that has been created using CQL results in:
 InvalidRequestException(why:Not enough bytes to read value of component 0)
Asynax is not handling the way CQL 3 stores things, see above.

- column family created using CQL is not visible via Cassandra CLI
            [default@test1] list employees1;
            employees1 not found in current keyspace.
Mmmm, it used to be.
Is it there when you do show schema ?

There is some interop between the two, but unless you really need to I would suggest avoiding
it.

Hope that helps.


-----------------
Aaron Morton
Freelance Cassandra Consultant
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 27/03/2013, at 5:08 AM, Marko Asplund <marko.asplund@gmail.com<mailto:marko.asplund@gmail.com>>
wrote:


Hi,

I'm experimenting with CQL3 and the non-CQL Cassandra data access
methods through Astyanax client API. Being new to Cassandra I'm a bit
puzzled by differences between the CQL3 data model and the non-CQL
based data model exposed by the Astyanax client API.
Is this data model defined by Thrift? How closely does it reflect the
Cassandra internal data model?

Is there any documentation or other online pointers describing these
different data models?
Can I use both access methods for a particular column family?
Can a column family that was created using CQL have columns added to
it dynamically?
Can I add CQL required metadata to column families created using
Cassandra CLI later, so that they can be accessed via CQL?

I'm trying to access data created using CQL by using non-CQL based
access methods and vice versa and I'm confused about the following
behaviour:

- trying to use MutationBatch for modifying a rows in column family
that has been created using CQL results in:
 InvalidRequestException(why:Not enough bytes to read value of component 0)

- column family created using CQL is not visible via Cassandra CLI
            [default@test1] list employees1;
            employees1 not found in current keyspace.

- row data in column family created using Cassandra CLI is not
deserialized when read using cqlsh (select * from X)

- when accessing data in a column family that was created using CQL
            keyspace.prepareQuery(CF).getKey(id)
 the column names seem to be encoded strangely and can't be identified

- in CQL query a result row a call on Row.getKey() returns null


I'm using Cassandra v1.2.3 and Astyanax v1.56.31.

thanks,

marko


_______________________________________________

This message may contain information that is confidential or privileged. If you are not an
intended recipient of this message, please delete it and any attachments, and notify the sender
that you have received it in error. Unless specifically stated in the message or otherwise
indicated, you may not duplicate, redistribute or forward this message or any portion thereof,
including any attachments, by any means to any other person, including any retail investor
or customer. This message is not a recommendation, advice, offer or solicitation, to buy/sell
any product or service, and is not an official confirmation of any transaction. Any opinions
presented are solely those of the author and do not necessarily represent those of Barclays.

This message is subject to terms available at: www.barclays.com/emaildisclaimer and, if received
from Barclays' Sales or Trading desk, the terms available at: www.barclays.com/salesandtradingdisclaimer/.
By messaging with Barclays you consent to the foregoing. Barclays Bank PLC is a company registered
in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP.
This email may relate to or be sent from other members of the Barclays group.

_______________________________________________

Mime
View raw message