cassandracqlcql3cassandra-cli

mismatched input ')' expecting EOF in CQL


created keyspace and using CQL but getting an Error

CREATE KEYSPACE demodb
           WITH strategy_class = 'org.apache.cassandra.locator.SimpleStrategy'
  ...          AND strategy_options:replication_factor='1';

cqlsh:demodb> CREATE TABLE users (
      ...                 user_name varchar,
      ...                 password varchar,
      ...                 gender varchar,
      ...                 session_token varchar,
      ...                 state varchar,
      ...                 birth_year bigint,
      ...                 PRIMARY KEY (user_name)
      ...               );
Bad Request: line 1:163 mismatched input ')' expecting EOF

why am i getting this error,any help,thanks.


Solution

  • Cassandra 1.0 has CQL2, and your statement is only valid in CQL3. You should upgrade to 1.2.10 or 2.0.1 since 1.0 is very old and CQL2 is deprecated.