http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows


On Fri, Aug 30, 2013 at 12:53 PM, Peter Lin <wool...@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 <j...@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.v...@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.mis...@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
>>
>>
>>
>>
>>
>>
>


-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder, http://www.datastax.com
@spyced

Reply via email to