2
votes
Drop keyspace if exists actionable;
CREATE KEYSPACE if not exists actionable WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

I get this error cassandra.protocol.SyntaxException: :0 missing EOF at 'CREATE' (... if exists "actionable";

could not find much documentation around it. but if I execute each statement alone it works. Is there some script file problem?

1
You mention "if I execute each statement alone, it works"; how are you executing the statements, if not one by one? - Castaglia
by running from a .cql file - ubreddy

1 Answers

2
votes

Which version of Cassandra are you using ?

Because I tested your script and it worked for me, I'm using Cassandra 3.5:

% cat /tmp/test.cql                                                                                                                                                   
Drop keyspace if exists actionable;
CREATE KEYSPACE if not exists actionable WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

% cqlsh -f /tmp/test.cql                                                                                                                          

% cqlsh --cqlversion=3.4.2 -e 'describe keyspace actionable'                                                                                                          

CREATE KEYSPACE actionable WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

Check your script file to see whether there are hidden line feed/new line characters or something similar