Cassandra Range Queries

I am new to Cassandra and am testing data modeling and range queries.

For training, I want to create a database where I can store log lines with their LogType and Log creation times. Where should I answer below:

Find loglines by log type between date range.

I Model of my database in the form of two families of columns: 1) Log

create column family log with comparator = 'UTF8Type' 
and key_validation_class = 'LexicalUUIDType'
and column_metadata=[{column_name: block, validation_class: UTF8Type}];

where I plan to store log lines using

ex: set log['7561a442-24e2-11df-8924-001ff3591711'][blocks]='someText|11-17-2011 23:40:42|sometext';

2)

create column family ltype with column_type = 'Super'
and comparator = 'TimeUUIDType'
and subcomparator = 'UTF8Type'
and column_metadata=[{column_name: id, validation_class: LexicalUUIDType}];

In this column family, I will store the log type along with the time and log line identifier from the journal column family:

ex: set ltype[ltype1][12307245916538][id]='7561a442-24e2-11df-8924-001ff3591711';

I want to get results when setting the log type and date range.

Can anyone advise me how to start a range query in a supercolumn family?

+5
source share
1
+6

All Articles