table-upcoming-calendar

INSERT INTO cycling.upcoming_calendar ( year, month, events )
VALUES ( 2015, 06, [ 'Criterium du Dauphine', 'Tour de Suisse' ] );

INSERT INTO cycling.upcoming_calendar ( year, month, events )
VALUES ( 2015, 07, [ 'Tour de France' ] );
INSERT INTO cycling.upcoming_calendar (
  year, month, events
) VALUES (
  2015, 07, [ 'Tour de France' ]
);
DELETE events[0] FROM cycling.upcoming_calendar
  WHERE year = 2015 AND month = 07;
  CREATE INDEX events_idx ON cycling.upcoming_calendar (events);
  CREATE INDEX events_idx ON cycling.upcoming_calendar (events)
    USING 'sai';
  CREATE CUSTOM INDEX events_idx ON cycling.upcoming_calendar (events)
    USING 'StorageAttachedIndex';
CREATE CUSTOM INDEX month_sasi_idx ON cycling.upcoming_calendar (month)
  USING 'org.apache.cassandra.index.sasi.SASIIndex';
DESCRIBE INDEX events_idx;
DESCRIBE INDEX month_sasi_idx;
DROP INDEX IF EXISTS cycling.events_idx;
DROP INDEX IF EXISTS cycling.month_sasi_idx;
SELECT * FROM cycling.upcoming_calendar
  WHERE events CONTAINS 'Criterium du Dauphine';
SELECT * FROM cycling.upcoming_calendar
  WHERE events CONTAINS 'Criterium du Dauphine'
    OR month = 7;
SELECT * FROM cycling.upcoming_calendar;
SELECT * FROM cycling.upcoming_calendar;
SELECT * FROM cycling.upcoming_calendar
  WHERE year = 2015 AND month = 6;
SELECT * FROM cycling.upcoming_calendar WHERE month = 06;
ALTER TABLE cycling.upcoming_calendar
  ADD description map<text,text>;
CREATE TABLE IF NOT EXISTS cycling.upcoming_calendar (
  year int,
  month int,
  events list<text>,
  PRIMARY KEY (year, month)
);
DESCRIBE TABLE cycling.upcoming_calendar;
DROP TABLE IF EXISTS cycling.upcoming_calendar;
UPDATE cycling.upcoming_calendar SET events = [ 'Criterium du Dauphine', 'Tour de Suisse' ]
  WHERE year = 2015 AND month = 06;
UPDATE cycling.upcoming_calendar SET events = events + [ 'Tour de France' ]
  WHERE year = 2017 AND month = 05;
UPDATE cycling.upcoming_calendar SET description = description + {
  'Criterium du Dauphine' : 'Easy race', 'Tour du Suisse' : 'Hard uphill race'
}
  WHERE year = 2015 AND month = 6;
UPDATE cycling.upcoming_calendar
SET description = {
  'Criterium du Dauphine' : 'Easy race', 'Tour du Suisse' : 'Hard uphill race'
}
WHERE year = 2015
  AND month = 6;
UPDATE cycling.upcoming_calendar SET events = events - ['Tour de France Stage 10']
  WHERE year = 2015 AND month = 07;
UPDATE cycling.upcoming_calendar SET description = description + {
  'Criterium du Dauphine' : 'Easy race'
}
  WHERE year = 2015 AND month = 06;
UPDATE cycling.upcoming_calendar SET events[2] = 'Tour de France'
  WHERE year = 2015 AND month = 06;
UPDATE cycling.upcoming_calendar SET events[2] = 'Vuelta Ciclista a Venezuela'
  WHERE year = 2015 AND month = 06;
UPDATE cycling.upcoming_calendar SET events = [ 'Tour de France' ] + events
  WHERE year = 2015 AND month = 06;
UPDATE cycling.upcoming_calendar USING TTL 10000000
  SET events[2] = 'Vuelta Ciclista a Venezuela'
  WHERE year = 2015 AND month = 06;

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