Search code examples
cassandracqlcql3cqlsh

Create a user-defined type with Cassandra


I am trying to create a user defined type with Cassandra. I am using cqlsh and the example provided in the documentation (http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/cqlRefcreateType.html):

REATE TYPE address (
  street text,
  city text,
  zip_code int,
  phones set<text>
)

But this returns:

Bad Request: line 1:7 no viable alternative at input 'TYPE'

Using the help command, I found the 'CREATE_TABLE_TYPES' but I could not get it to work either.

What is the correcft syntax to get this to work?

Many thanks


Solution

  • I also struck with same problem. User type doesn't supported by earlier version of 2.1. Now i am using 2.1.2 version of cassandra.

    You can find it NEW FEATURES of Cassandra