You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Shahab Yunus <sh...@gmail.com> on 2013/07/12 17:13:41 UTC
Representation of dynamically added columns in table (column family)
schema using cqlsh
A basic question and it seems that I have a gap in my understanding.
I have a simple table in Cassandra with multiple column families. I add new
columns to each of these column families on the fly. When I view (using the
'DESCRIBE table' command) the schema of a particular column family, I see
only one entry for column (bolded below). What is the reason for that? The
column that I am adding have string names and byte values, written using
Hector 1.1-3 (
HFactory.createColumn(...) method).
CREATE TABLE mytable (
key text,
*column1* ascii,
value blob,
PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE AND
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=1.000000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};
cqlsh 3.0.2
Cassandra 1.2.5
CQL spec 3.0.0
Thrift protocol 19.36.0
Given this, I can also only query on this one column1 or value using the
'SELECT' statement.
The OpsCenter on the other hand, displays multiple columns as
expected. Basically the demarcation of multiple columns i clearer.
Thanks a lot.
Regards,
Shahab
Re: Representation of dynamically added columns in table (column
family) schema using cqlsh
Posted by Tristan Seligmann <mi...@mithrandi.net>.
See http://www.datastax.com/dev/blog/thrift-to-cql3 for more information.
On Sat, Jul 13, 2013 at 1:19 AM, Eric Stevens <mi...@gmail.com> wrote:
> If you're creating dynamic columns via Thrift interface, they will not be
> reflected in the CQL3 schema. I would recommend not mixing paradigms like
> that, either stick with CQL3 or Thrift / cassandra-cli. With compact
> storage creates column families which can be interacted with meaningfully
> via Thrift, but you'll be lacking any metadata on those columns to interact
> with them via cql.
>
>
> On Fri, Jul 12, 2013 at 11:13 AM, Shahab Yunus <sh...@gmail.com>wrote:
>
>> A basic question and it seems that I have a gap in my understanding.
>>
>> I have a simple table in Cassandra with multiple column families. I add
>> new columns to each of these column families on the fly. When I view (using
>> the 'DESCRIBE table' command) the schema of a particular column family, I
>> see only one entry for column (bolded below). What is the reason for that?
>> The column that I am adding have string names and byte values, written
>> using Hector 1.1-3 (
>> HFactory.createColumn(...) method).
>>
>> CREATE TABLE mytable (
>> key text,
>> *column1* ascii,
>> value blob,
>> PRIMARY KEY (key, column1)
>> ) WITH COMPACT STORAGE AND
>> 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=1.000000 AND
>> replicate_on_write='true' AND
>> populate_io_cache_on_flush='false' AND
>> compaction={'class': 'SizeTieredCompactionStrategy'} AND
>> compression={'sstable_compression': 'SnappyCompressor'};
>>
>> cqlsh 3.0.2
>> Cassandra 1.2.5
>> CQL spec 3.0.0
>> Thrift protocol 19.36.0
>>
>>
>> Given this, I can also only query on this one column1 or value using the
>> 'SELECT' statement.
>>
>> The OpsCenter on the other hand, displays multiple columns as
>> expected. Basically the demarcation of multiple columns i clearer.
>>
>> Thanks a lot.
>>
>> Regards,
>> Shahab
>>
>
>
--
mithrandi, i Ainil en-Balandor, a faer Ambar
Re: Representation of dynamically added columns in table (column
family) schema using cqlsh
Posted by Eric Stevens <mi...@gmail.com>.
If you're creating dynamic columns via Thrift interface, they will not be
reflected in the CQL3 schema. I would recommend not mixing paradigms like
that, either stick with CQL3 or Thrift / cassandra-cli. With compact
storage creates column families which can be interacted with meaningfully
via Thrift, but you'll be lacking any metadata on those columns to interact
with them via cql.
On Fri, Jul 12, 2013 at 11:13 AM, Shahab Yunus <sh...@gmail.com>wrote:
> A basic question and it seems that I have a gap in my understanding.
>
> I have a simple table in Cassandra with multiple column families. I add
> new columns to each of these column families on the fly. When I view (using
> the 'DESCRIBE table' command) the schema of a particular column family, I
> see only one entry for column (bolded below). What is the reason for that?
> The column that I am adding have string names and byte values, written
> using Hector 1.1-3 (
> HFactory.createColumn(...) method).
>
> CREATE TABLE mytable (
> key text,
> *column1* ascii,
> value blob,
> PRIMARY KEY (key, column1)
> ) WITH COMPACT STORAGE AND
> 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=1.000000 AND
> replicate_on_write='true' AND
> populate_io_cache_on_flush='false' AND
> compaction={'class': 'SizeTieredCompactionStrategy'} AND
> compression={'sstable_compression': 'SnappyCompressor'};
>
> cqlsh 3.0.2
> Cassandra 1.2.5
> CQL spec 3.0.0
> Thrift protocol 19.36.0
>
>
> Given this, I can also only query on this one column1 or value using the
> 'SELECT' statement.
>
> The OpsCenter on the other hand, displays multiple columns as
> expected. Basically the demarcation of multiple columns i clearer.
>
> Thanks a lot.
>
> Regards,
> Shahab
>
Re: Representation of dynamically added columns in table (column
family) schema using cqlsh
Posted by Shahab Yunus <sh...@gmail.com>.
See this as this was discussed earlier:
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Representation-of-dynamically-added-columns-in-table-column-family-schema-using-cqlsh-td7588997.html
Regards,
Shahab
On Fri, Jul 12, 2013 at 11:13 AM, Shahab Yunus <sh...@gmail.com>wrote:
> A basic question and it seems that I have a gap in my understanding.
>
> I have a simple table in Cassandra with multiple column families. I add
> new columns to each of these column families on the fly. When I view (using
> the 'DESCRIBE table' command) the schema of a particular column family, I
> see only one entry for column (bolded below). What is the reason for that?
> The column that I am adding have string names and byte values, written
> using Hector 1.1-3 (
> HFactory.createColumn(...) method).
>
> CREATE TABLE mytable (
> key text,
> *column1* ascii,
> value blob,
> PRIMARY KEY (key, column1)
> ) WITH COMPACT STORAGE AND
> 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=1.000000 AND
> replicate_on_write='true' AND
> populate_io_cache_on_flush='false' AND
> compaction={'class': 'SizeTieredCompactionStrategy'} AND
> compression={'sstable_compression': 'SnappyCompressor'};
>
> cqlsh 3.0.2
> Cassandra 1.2.5
> CQL spec 3.0.0
> Thrift protocol 19.36.0
>
>
> Given this, I can also only query on this one column1 or value using the
> 'SELECT' statement.
>
> The OpsCenter on the other hand, displays multiple columns as
> expected. Basically the demarcation of multiple columns i clearer.
>
> Thanks a lot.
>
> Regards,
> Shahab
>
Re: Representation of dynamically added columns in table (column
family) schema using cqlsh
Posted by Shahab Yunus <sh...@gmail.com>.
Thanks Eric for the explanation.
Regards,
Shahab
On Fri, Jul 12, 2013 at 11:13 AM, Shahab Yunus <sh...@gmail.com>wrote:
> A basic question and it seems that I have a gap in my understanding.
>
> I have a simple table in Cassandra with multiple column families. I add
> new columns to each of these column families on the fly. When I view (using
> the 'DESCRIBE table' command) the schema of a particular column family, I
> see only one entry for column (bolded below). What is the reason for that?
> The column that I am adding have string names and byte values, written
> using Hector 1.1-3 (
> HFactory.createColumn(...) method).
>
> CREATE TABLE mytable (
> key text,
> *column1* ascii,
> value blob,
> PRIMARY KEY (key, column1)
> ) WITH COMPACT STORAGE AND
> 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=1.000000 AND
> replicate_on_write='true' AND
> populate_io_cache_on_flush='false' AND
> compaction={'class': 'SizeTieredCompactionStrategy'} AND
> compression={'sstable_compression': 'SnappyCompressor'};
>
> cqlsh 3.0.2
> Cassandra 1.2.5
> CQL spec 3.0.0
> Thrift protocol 19.36.0
>
>
> Given this, I can also only query on this one column1 or value using the
> 'SELECT' statement.
>
> The OpsCenter on the other hand, displays multiple columns as
> expected. Basically the demarcation of multiple columns i clearer.
>
> Thanks a lot.
>
> Regards,
> Shahab
>