PLANNED MAINTENANCE

Hello, DataStax Community!

We want to make you aware of a few operational updates which will be carried out on the site. We are working hard to streamline the login process to integrate with other DataStax resources. As such, you will soon be prompted to update your password. Please note that your username will remain the same.

As we work to improve your user experience, please be aware that login to the DataStax Community will be unavailable for a few hours on:

  • Wednesday, July 15 16:00 PDT | 19:00 EDT | 20:00 BRT
  • Thursday, July 16 00:00 BST | 01:00 CEST | 04:30 IST | 07:00 CST | 09:00 AEST

For more info, check out the FAQ page. Thank you for being a valued member of our community.


question

michael.shatz_192704 avatar image
michael.shatz_192704 asked ·

What are the possible filters that can be used on my table?

The Cassandra DB contains the following table: metric.metric

What are the possible filters that can be used for the following table metric.metric?

cqlsh> SELECT * FROM metric.metric LIMIT 1;
 id                                                                                                                  | time       | point
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
{path: 'first.node.threadpool.CACHE.monitored_idle', resolution: {precision: 3600, period: 31536000}} | 1586700000 | {max: 0, mean: 0, min: 0, sum: 0}
id={path: 'first.node.threadpool.CACHE.monitored_idle', resolution: {precision: 3600, period: 31536000}}
time=1586700000
point={max: 0, mean: 0, min: 0, sum: 0}


Update: detailed schema

cqlsh> DESC SCHEMA
CREATE KEYSPACE metric WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;

CREATE TYPE metric.metric_resolution (
   precision int,
   period int
);

CREATE TYPE metric.metric_id (
   path text,
   resolution frozen<metric_resolution>
);

CREATE TYPE metric.metric_point (
   max double,
   mean double,
   min double,
   sum double
);

CREATE TABLE metric.metric (
   id frozen<metric_id>,
   time bigint,
   point frozen<metric_point>,
   PRIMARY KEY (id, time)
) 
WITH CLUSTERING ORDER BY (time ASC)
AND ...

CREATE TABLE metric.segment (
   parent text,
   segment text,
   leaf boolean,
   length int,
   pos int,
   PRIMARY KEY (parent, segment)
) 
WITH CLUSTERING ORDER BY (segment ASC)
AND ...


cassandradata modeling
1 comment
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi @michael.shatz_192704,

a quick note that I added your update to the initial question post, as it was too long to be added to the comments.

Cheers!

0 Likes 0 · ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

You haven't provided much information and typically you should provide the table schema for us to make a meaningful response. In any case, I'm going to assume that the primary key and partition key are both:

    PRIMARY KEY (id)

On this basis, you can only filter based on id. Cheers!

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

@michael.shatz_192704 based on the table schema, you can only filter on the partition key as I stated previously. Cheers!

1 Like 1 · ·