incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Les Hartzman <lhartz...@gmail.com>
Subject Wide rows/composite keys clarification needed
Date Mon, 21 Oct 2013 04:34:30 GMT
Please correct me if I'm not describing this correctly. But if I am
collecting sensor data and have a table defined as follows:

         create table sensor_data (
               sensor_id int,
               time_stamp int,  // time to the hour granularity
               voltage float,
               amp float,
               PRIMARY KEY (sensor_id, time_stamp) ));

The partitioning value is the sensor_id and the rest of the PK components
become part of the column name for the additional fields, in this case
voltage and amp.

What goes into determining what additional data is inserted into this row?
The first time an insert takes place there will be one entry for all of the
fields. Is there anything besides the sensor_id that is used to determine
that the subsequent insertions for that sensor will go into the same row as
opposed to starting a new row?

Base on something I read (but can't currently find again), I thought that
as long as all of the elements of the PK remain the same (same sensor_id
and still within the same hour as the first reading), that the next
insertion would be tacked onto the end of the first row. Is this correct?

For subsequent entries into the same row for additional voltage/amp
readings, what are the names of the columns for these readings? My
understanding is that the column name becomes a concatenation of the
non-row key field names plus the data field names.So if the first go-around
you have <time_stamp>:<voltage> and <time_stamp>:<amp>, what do the
subsequent column names become?

Thanks.

Les

Mime
View raw message