cassandracassandra-3.0cqlsh

Unable to create a table with comment


I am trying to create a table and want to add a comment in the schema but I am not able to get the syntax correct.

CREATE TABLE codingjedi.practice_questions_javascript_tag(
  year bigint,
  month bigint,
  creation_time_hour bigInt,
  creation_time_minute bigInt,
  id uuid,
  PRIMARY KEY ((year, month), creation_time_hour, creation_time_minute)  
) WITH comment = 'some comment' CLUSTERING ORDER BY (creation_time_hour DESC, creation_time_minute ASC) 

Solution

  • I had to use AND to combine the two instruction

    CREATE TABLE codingjedi.practice_questions_javascript_tag(
      year bigint,
      month bigint,
      creation_time_hour bigInt,
      creation_time_minute bigInt,
      id uuid,
      PRIMARY KEY ((year,month), creation_time_hour, creation_time_minute, id )  
    ) WITH comment = 'some comment' AND CLUSTERING ORDER BY (creation_time_hour DESC, creation_time_minute ASC, question_id ASC);