incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Lin <wool...@gmail.com>
Subject Re: CQL & Thrift
Date Fri, 30 Aug 2013 18:10:46 GMT
in my case, I built a temporal database on top of Cassandra, so it's
absolutely key.

Dynamic columns are super powerful, which relational database have no
equivalent. For me, that is one of the top 3 reasons for using Cassandra.



On Fri, Aug 30, 2013 at 2:03 PM, Vivek Mishra <mishra.vivs@gmail.com> wrote:

> If you talk about comparator. Yes, that's a valid point and not possible
> with CQL3.
>
> -Vivek
>
>
> On Fri, Aug 30, 2013 at 11:31 PM, Peter Lin <woolfel@gmail.com> wrote:
>
>>
>> I use dynamic columns all the time and they vary in type.
>>
>> With CQL you can define a default type, but you can't insert specific
>> types of data for column name and value. It forces you to use all bytes or
>> all strings, which would require coverting it to other types.
>>
>> thrift is much more powerful in that respect.
>>
>> not everyone needs to take advantage of the full power of dynamic columns.
>>
>>
>> On Fri, Aug 30, 2013 at 1:58 PM, Jon Haddad <jon@jonhaddad.com> wrote:
>>
>>> Just curious - what do you need to do that requires thrift?  We've build
>>> our entire platform using CQL3 and we haven't hit any issues.
>>>
>>> On Aug 30, 2013, at 10:53 AM, Peter Lin <woolfel@gmail.com> wrote:
>>>
>>>
>>> my bias perspective, I find the sweet spot is thrift for insert/update
>>> and CQL for select queries.
>>>
>>> CQL is too limiting and negates the power of storing arbitrary data
>>> types in dynamic columns.
>>>
>>>
>>> On Fri, Aug 30, 2013 at 1:45 PM, Jon Haddad <jon@jonhaddad.com> wrote:
>>>
>>>> If you're going to work with CQL, work with CQL.  If you're going to
>>>> work with Thrift, work with Thrift.  Don't mix.
>>>>
>>>> On Aug 30, 2013, at 10:38 AM, Vivek Mishra <mishra.vivs@gmail.com>
>>>> wrote:
>>>>
>>>> Hi,
>>>> If i a create a table with CQL3 as
>>>>
>>>> create table user(user_id text PRIMARY KEY, first_name text, last_name
>>>> text, emailid text);
>>>>
>>>> and create index as:
>>>> create index on user(first_name);
>>>>
>>>> then inserted some data as:
>>>> insert into user(user_id,first_name,last_name,"emailId")
>>>> values('@mevivs','vivek','mishra','vivek.mishra@impetus.co.in');
>>>>
>>>>
>>>> Then if update same column family using Cassandra-cli as:
>>>>
>>>> update column family user with key_validation_class='UTF8Type' and
>>>> column_metadata=[{column_name:last_name, validation_class:'UTF8Type',
>>>> index_type:KEYS},{column_name:first_name, validation_class:'UTF8Type',
>>>> index_type:KEYS}];
>>>>
>>>>
>>>> Now if i connect via cqlsh and explore user table, i can see column
>>>> first_name,last_name are not part of table structure anymore. Here is the
>>>> output:
>>>>
>>>> CREATE TABLE user (
>>>>   key text PRIMARY KEY
>>>> ) WITH
>>>>   bloom_filter_fp_chance=0.010000 AND
>>>>   caching='KEYS_ONLY' AND
>>>>   comment='' AND
>>>>   dclocal_read_repair_chance=0.000000 AND
>>>>   gc_grace_seconds=864000 AND
>>>>   read_repair_chance=0.100000 AND
>>>>   replicate_on_write='true' AND
>>>>   populate_io_cache_on_flush='false' AND
>>>>   compaction={'class': 'SizeTieredCompactionStrategy'} AND
>>>>   compression={'sstable_compression': 'SnappyCompressor'};
>>>>
>>>> cqlsh:cql3usage> select * from user;
>>>>
>>>>  user_id
>>>> ---------
>>>>  @mevivs
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> I understand that, CQL3 and thrift interoperability is an issue. But
>>>> this looks to me a very basic scenario.
>>>>
>>>>
>>>>
>>>> Any suggestions? Or If anybody can explain a reason behind this?
>>>>
>>>> -Vivek
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>

Mime
View raw message