incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <aa...@thelastpickle.com>
Subject Re: CQL vs. non-CQL data models
Date Thu, 28 Mar 2013 02:41:32 GMT
> 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> 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


Mime
View raw message