【问题标题】:'create table' event ... with Apache Cassandra'create table' 事件......使用 Apache Cassandra
【发布时间】:2015-04-18 01:12:00
【问题描述】:

我正在尝试运行 Cassandra 服务器。为此,我只是按照该页面上的教程进行操作 (http://www.opencredo.com/2014/10/23/spring-data-cassandra-overview/)。

我被困在这一步:设置 Cassandra

当我尝试按照教程中的描述创建一个表时,我得到了一个 ErrorMessage code=2000。

cqlsh:events> CREATE TABLE event ( 
  type text, bucket text, id timeuuid, tags set, 
  PRIMARY KEY (( type, bucket), id)) WITH CLUSTERING ORDER BY (id DESC);

ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:66
mismatched input ',' expecting '<' (..., id timeuuid, tags set[,] PRIMARY...)"

经过深入研究,我仍然不知道这里的问题是什么,有人知道这里可能存在什么问题吗?

我的版本是:

[cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 | Native protocol v3]

【问题讨论】:

    标签: create-table cqlsh cassandra-2.1


    【解决方案1】:

    您必须指定集合的​​类型,例如:

    CREATE TABLE event (
      type text,
      bucket text,
      id timeuuid,
      tags set<text>,
      PRIMARY KEY ((type, bucket), id)
    ) WITH CLUSTERING ORDER BY (id DESC);
    

    欲了解更多信息,请参阅this link

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-01
      • 2018-06-06
      • 2015-10-09
      • 2013-06-29
      • 2020-09-30
      • 2016-07-07
      • 2019-06-26
      • 2011-05-02
      相关资源
      最近更新 更多