OK, I have been struggling using the cassandra_1.2.schema on my cassandra 2.2 install. I noticed the CQL syntax has been completely revamped. For instance, in order to create the table I had to run the following:
create keyspace CNS with replication={ 'class':'SimpleStrategy','replication_factor':1 };
create keyspace CQS with replication={ 'class':'SimpleStrategy','replication_factor':1 };
create keyspace CMB with replication={ 'class':'SimpleStrategy','replication_factor':1 };
and when I created the first table I had to change the syntax to the following:
create columnfamily CNSTopics (
userId varchar,
displayName varchar,
name varchar,
primary key (userId))
with caching = { 'keys' : 'ALL' }
and read_repair_chance = 0
and dclocal_read_repair_chance = 0.05
and replicate_on_write = true
and compaction = {'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'}
;
All of the above was created successfully however when I tried to create the second table it failed to create because there wasn't a column nor a primary key specified. Here is the output with the error:
cqlsh:cns> create columnfamily CNSTopicsByUserId (
... )
... with caching = { 'keys' : 'ALL' }
... and read_repair_chance = 0
... and dclocal_read_repair_chance = 0.05
... and replicate_on_write = true
... and compaction = {'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'}
... ;
SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 2:0 no viable alternative at input ')' (create columnfamily CNSTopicsByUserId ([)]...)">
It looks like the file was generated to be used with the command cassandra-cli which has been deprecated in 2.2 and replaced with cqlsh
Should I try to use cassandra2.1?
Thanks for the help
Christopher Curts