Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cassandra 输入不匹配(';)';CQL中的期望EOF_Cassandra_Cql_Cql3_Cassandra Cli - Fatal编程技术网

Cassandra 输入不匹配(';)';CQL中的期望EOF

Cassandra 输入不匹配(';)';CQL中的期望EOF,cassandra,cql,cql3,cassandra-cli,Cassandra,Cql,Cql3,Cassandra Cli,创建键空间并使用CQL,但出现错误 CREATE KEYSPACE demodb WITH strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' ... AND strategy_options:replication_factor='1'; cqlsh:demodb> CREATE TABLE users ( ... user_

创建键空间并使用CQL,但出现错误

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

为什么我会收到这个错误,需要帮助吗,谢谢。

Cassandra 1.0有CQL2,您的声明只在CQL3中有效。您应该升级到1.2.10或2.0.1,因为1.0非常旧,CQL2已被弃用。

有时会出现错误,因为语法可能错误。检查支架是否正确闭合。尝试将查询存储为字符串并打印它。如果它是正确的,那么正如Richard所说,您可能对CQL的版本有问题。否则,这只是一个语法错误,您必须仔细查看。

它在1.2.10中适用于我。你有哪个卡桑德拉版本?在ubuntu-13.04中安装了dsc=1.0.10卡桑德拉=1.0.10我也需要升级dsc吗?升级到哪个版本?,非常感谢。DSC是Cassandra的Datastax发行版-您可以想要这个版本,也可以想要Apache版本。我只想要DSC,因为我在ubuntu上运行CQL??我已经安装了Cassandra,但没有DSC,所以我无法使用cqlsh,然后我转到了DSC,这方面的任何帮助,谢谢。