0

I am very new to Cassandra and am trying to use the new LIKE feature but keep getting the error

Line 1: no viable alternative at input 'LIKE'

I am using DataStax DevCenter and am following the examples on https://docs.datastax.com/en/cql/3.3/cql/cql_using/useSASIIndex.html .I am using Cassandra version 3.7.0 and CQL 3.4.2 and the Datastex version is 1.60 community . I have a table named zips with a text field called city that has 10,000 records and am simply using this CQL code

SELECT * FROM "MyTable".zips WHERE city LIKE 'M%';

Before that I added an index using

CREATE CUSTOM INDEX  fn_prefix ON "MyTable".zips (city) USING 'org.apache.cassandra.index.sasi.SASIIndex';

I know that the index worked because it allowed me to do this query

SELECT * FROM "Exoler".zips WHERE city='Miami';

without using allow filter and it returns values. Any suggestions would be great as stated I am very new to this.

mmatloka
  • 1,986
  • 1
  • 20
  • 46
user1591668
  • 2,591
  • 5
  • 41
  • 84
  • Are you sure of the version of Cassandra you are using? Can you please run `cqlsh` and check the version once. – Dip Aug 18 '16 at 18:50
  • yes I am running version 3.7 and I know it because I ran this command select release_version from system.local; – user1591668 Aug 19 '16 at 00:21
  • what version of DevCenter are you using? Have you tried 1.6 http://www.datastax.com/dev/blog/devcenter-1-6-0-is-now-available? – Alex Popescu Aug 19 '16 at 09:26

1 Answers1

1

If you use Cassandra 3.9 and Datastax DevCenter version 1.5.0 or 1.6.0 it won't support LIKE (atleast on Windows). The result is only "no viable alternative at input 'LIKE'"

But it works fine if you use command prompt:

WINDOWS-Key
cmd
"%CASSANDRA_HOME%\bin\cqlsh"

It is just a bug in Datastax DevCenter I guess.

Erwin
  • 662
  • 5
  • 12