2

I am using cassandra database cassandra:2.2.3 in my application and i should use like operator to get all the names starts with 'A%'.

CREATE CUSTOM INDEX  empnames_idx ON d.emp (ename)
USING 'org.apache.cassandra.index.sasi.SASIIndex';

After creating the index when i run the below query :

select * from d.emp where ename like 'A%';

<Error from server: code=2000 [Syntax error in CQL query] message="line 1:49 no viable alternative at input 'LIKE' (...* from d.emp where ename like .....)"
Studentlearner
  • 99
  • 2
  • 11

1 Answers1

2

It's not supported until 3.4+ but should upgrade to 3.11.latest. You may want to configure your index as well, an excellent walkthrough is here: http://www.doanduyhai.com/blog/?p=2058

Chris Lohfink
  • 16,150
  • 1
  • 29
  • 38