2

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?

Ryan Caskey
  • 607
  • 8
  • 20

1 Answers1

3

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

Ryan Caskey
  • 607
  • 8
  • 20