table-comments-vs-dse68

INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),e7ae5cf3-d358-4d99-b900-85902fda9bb0, 'Alex','Raining too hard should have postponed','2017-02-14 12:43:20-0800');
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),e7ae5cf3-d358-4d99-b900-85902fda9bb0,'Alex','Second rest stop was out of water','2017-03-21 13:11:09.999-0800');
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),e7ae5cf3-d358-4d99-b900-85902fda9bb0,'Alex','LATE RIDERS SHOULD NOT DELAY THE START','2017-04-01 06:33:02.16-0800');
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),c7fceba0-c141-4207-9494-a29f9809de6f,'Amy','The gift certificate for winning was the best',totimestamp(now()));
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),c7fceba0-c141-7207-9494-a29f9809de6f,'Amy','The <B>gift certificate</B> for winning was the best',totimestamp(now()));
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),c7fceba0-c141-4207-9494-a29f9809de6f,'Amy','Glad you ran the race in the rain','2017-02-17 12:43:20.234+0400');
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),c7fceba0-c141-4207-9594-a29f9809de6f,'Jane','Boy, was it a drizzle out there!','2017-02-17 12:43:20.234+0400');
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(), c7fceba0-c141-3207-9494-a29f9809de6f,'Amy','THE RACE WAS FABULOUS!','2017-02-17 12:43:20.234+0400');
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),c7fceba0-c141-4207-9494-a29f9809de6f, 'Amy','Great snacks at all reststops','2017-03-22 5:16:59.001+0400');
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),c7fceba0-c141-4207-9494-a29f9809de6f,'Amy','Last climb was a killer','2017-04-01 17:43:08.030+0400');
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),e8ae5cf3-d358-4d99-b900-85902fda9bb0,'John','rain, rain,rain, go away!','2017-04-01 06:33:02.16-0800');
INSERT INTO cycling.comment_vs_dse_68 (record_id, id, commenter, comment, created_at) VALUES (now(),e8ae5df3-d358-4d99-b900-85902fda9bb0,'Jane','Rain like a monsoon','2017-04-01 06:33:02.16-0800');
CREATE CUSTOM INDEX commenter_idx ON cycling.comment_vs_dse_68 (commenter)
  USING 'StorageAttachedIndex'
  WITH OPTIONS = {'case_sensitive': 'true', 'normalize': 'true', 'ascii': 'true'};
CREATE CUSTOM INDEX commenter_idx ON cycling.comment_vs_dse_68 (commenter)
  USING 'StorageAttachedIndex';
CREATE CUSTOM INDEX created_at_idx ON cycling.comment_vs_dse_68 (created_at)
  USING 'StorageAttachedIndex';
DESCRIBE INDEX cycling.commenter_idx;
DESCRIBE INDEX cycling.commenter_idx;
DESCRIBE INDEX cycling.created_at_idx;
DROP INDEX IF EXISTS cycling.commenter_idx;
DROP INDEX IF EXISTS cycling.created_at_idx;
SELECT comment,comment_vector,commenter FROM cycling.comment_vs_dse_68;
SELECT * FROM cycling.comment_vs_dse_68 WHERE commenter = 'alex';
SELECT * FROM cycling.comment_vs_dse_68 WHERE commenter = 'Alex';
SELECT * FROM cycling.comment_vs_dse_68
  WHERE created_at='2017-03-21 21:11:09.999'
  AND commenter = 'Alex';
SELECT * FROM cycling.comment_vs_dse_68
  WHERE created_at IN ('2017-03-21 21:11:09.999','2017-03-22 01:16:59.001') ALLOW FILTERING;
# SELECT * FROM cycling.comment_vs_dse_68
#   WHERE created_at='2017-03-21 21:11:09.999000+0000'
#   OR created_at='2017-03-22 01:16:59.001000+0000';
SELECT * FROM cycling.comment_vs_dse_68 WHERE commenter = 'Alex';
SELECT id, commenter, toJson(created_at) FROM cycling.comment_vs_dse_68;
ALTER TABLE cycling.comment_vs_dse_68
  ADD comment_vector VECTOR <FLOAT, 5>; (1)
CREATE TABLE IF NOT EXISTS cycling.comment_vs_dse_68 (
  record_id timeuuid,
  id uuid,
  commenter text,
  comment text,
  created_at timestamp,
  PRIMARY KEY (id, created_at)
)
WITH CLUSTERING ORDER BY (created_at DESC);
DESCRIBE TABLE cycling.comment_vs_dse_68;
DROP TABLE IF EXISTS cycling.comment_vs_dse_68;

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com