" Using the post's example, consider the query of "get all readings for sensor 1". With dynamic columns, the query is just "select * from data where sensor_id=1". In CQL, not only does this take N different queries (one per sample) but you have to explicitly know the collected_at values to query for. Right?" This does work in CQL (v3.1.1 , tried on Cassandra 2.0.4)
cqlsh:playlist> CREATE TABLE data ( ... sensor_id int, ... collected_at timestamp, ... volts float, ... PRIMARY KEY (sensor_id, collected_at) ... ) WITH COMPACT STORAGE; cqlsh:playlist> insert into data(sensor_id,collected_at,volts) values (1,'2014-0 5-01 00:00:00',1.2); cqlsh:playlist> insert into data(sensor_id,collected_at,volts) values (1,'2014-0 5-02 00:00:00',1.3); cqlsh:playlist> insert into data(sensor_id,collected_at,volts) values (1,'2014-0 5-03 00:00:00',1.4); cqlsh:playlist> insert into data(sensor_id,collected_at,volts) values (2,'2014-0 5-03 00:00:00',2.4); cqlsh:playlist> select * from data; sensor_id | collected_at | volts -----------+------------------------------------------+------- 1 | 2014-05-01 00:00:00Pacific Daylight Time | 1.2 1 | 2014-05-02 00:00:00Pacific Daylight Time | 1.3 1 | 2014-05-03 00:00:00Pacific Daylight Time | 1.4 2 | 2014-05-03 00:00:00Pacific Daylight Time | 2.4 (4 rows) cqlsh:playlist> select * from data where sensor_id=1; sensor_id | collected_at | volts -----------+------------------------------------------+------- 1 | 2014-05-01 00:00:00Pacific Daylight Time | 1.2 1 | 2014-05-02 00:00:00Pacific Daylight Time | 1.3 1 | 2014-05-03 00:00:00Pacific Daylight Time | 1.4 (3 rows) cqlsh:playlist> On Tue, Aug 26, 2014 at 12:33 PM, Ian Rose <ianr...@fullstory.com> wrote: > Unfortunately, no. I've read that and the solution presented only works > in limited scenarios. Using the post's example, consider the query of "get > all readings for sensor 1". With dynamic columns, the query is just > "select * from data where sensor_id=1". In CQL, not only does this take N > different queries (one per sample) but you have to explicitly know the > collected_at values to query for. Right? > > The other suggestion, to use collections (such as a map), again works in > some circumstances, but not all. In particular, each item in a collection > is limited to 64k bytes which is not something we want to be limited to (we > are storing byte arrays that occasionally exceed this size). > > > > On Tue, Aug 26, 2014 at 3:14 PM, Shane Hansen <shanemhan...@gmail.com> > wrote: > >> Does this answer your question Ian? >> >> http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows >> >> >> >> On Tue, Aug 26, 2014 at 1:12 PM, Ian Rose <ianr...@fullstory.com> wrote: >> >>> Is it possible in CQL to create a table that supports dynamic column >>> names? I am using C* v2.0.9, which I assume implies CQL version 3. >>> >>> This page appears to show that this was supported in CQL 2 with the >>> 'with comparator' and 'with default_validation' options but that CQL 3 does >>> not support this: http://www.datastax.com/dev/blog/whats-new-in-cql-3-0 >>> >>> Am I understanding that right? If so, what is my best course of action? >>> Create the table using the cassandra-cli tool? >>> >>> Thanks, >>> - Ian >>> >>> >> >