PeeWee2201
PeeWee2201

Reputation: 1524

Do I have a wide row?

I created a table with this staement

CREATE TABLE history (
  salt int,
  tagName varchar,
  day timestamp,
  room int static,
  component varchar static,
  instance varchar static,
  property varchar static,
  offset int,
  value float,
  PRIMARY KEY ((salt,tagName,day), offset)
);

The goal is to have for each rowkey (salt, tagName, day)

Day is just the current day (e.g. '2016-06-08'), not the current timestamp.

Salt will be very small. It is there to avoid exceeding row size if data is sampled very fast

I wanted to check my schema with the thrift client but it is no longer installed with the 3.5 version I have.

Is my schema correct for my goal? Is there a way to see the actual 'physical' rows with cqlsh?

Thanks!

Upvotes: 1

Views: 111

Answers (1)

undefined_variable
undefined_variable

Reputation: 6218

cassandra-cli equivalent of your cql will be

RowKey (salt:tagName:day)
column(offsetvalue:,value= ,timestamp=sometimestamp)
column(offsetvalue:room,value=roomValue,timestamp=sometimestamp)
column(offsetvalue:component ,value=componentValue,timestamp=sometimestamp)
column(offsetvalue:instance,value=instanceValue,timestamp=sometimestamp)
column(offsetvalue:property,value=propertyValue,timestamp=sometimestamp)
column(offsetvalue:value,value=valueValue,timestamp=sometimestamp)

Upvotes: 1

Related Questions