no viable alternative at character ']' when updating columnfamily

389 Views Asked by At

I'm new to Cassandra, but am trying to update a column family to have secondary indexes on some of the columns. After creating my column family, I run the following line of code:

db.ExecuteNonQuery("UPDATE COLUMN FAMILY Targets with comparator = UTF8Type and column_metadata=[{column_name: Age, validation_class: UTF8Type, index_type: KEYS}];");

The problem is I get the following error:
line 1:141 no viable alternative at character ']'

I can run that exact statement using the CLI without any issues.

Suggestions?

1

There are 1 best solutions below

0
On BEST ANSWER

Looks like I need to use CQL when running ExecuteNonQuery: http://www.datastax.com/docs/0.8/dml/using_cql