1

I am trying to run a Cassandra server. For that i just followed the tutorial on that page (http://www.opencredo.com/2014/10/23/spring-data-cassandra-overview/).

I am stuck on the step: Setting up Cassandra

When i try to create a table as described in tutorial i got an 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...)"

After intensive research I still don't know what the problem here is, does anyone have a clue what a problem could be here?

My version is:

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

1 回答 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);

有关更多信息,请参阅此链接

于 2015-02-17T11:52:19.657 回答