No viable alternative at input '>' in cassandra

1.4k views Asked by At

What is the issue with these command cos for every command i am getting no viable alternative at input '>' error

CREATE TABLE collect_things (
           ...   k int PRIMARY KEY,
           ...   v <tuple<int,text,float>>
           ... );

CREATE TABLE collect_things (
           ...   k int PRIMARY KEY,
           ...   v tuple<float, float, text>
           ... );


CREATE TABLE tuple_test (
           ... the_key int PRIMARY KEY,
           ... the_tuple frozen<tuple<int, text, float>>)
           ... ;

Spec: [cqlsh 4.1.1 | Cassandra 2.0.8 | CQL spec 3.1.1 | Thrift protocol 19.39.0]

1

There are 1 answers

0
wherby On

You could see more from http://docs.datastax.com/en/cql/3.1/cql/cql_reference/create_table_r.html

To support future capabilities, a column definition of a user-defined or tuple type requires the frozen keyword. Cassandra serializes a frozen value having multiple components into a single value. For examples and usage information, see "Using a user-defined type", "Tuple type", and Collection type.

Note: Cassandra 2.1.0 to 2.1.2 requires using frozen for tuples:

frozen <tuple <int, tuple<text, double>>>

Cassandra 2.1.3+ does not require this keyword.