multiple predicates joined by OR
Hi
I have been exploring SASI indexing with your documented examples with my project but I could not make successful query of multiple predicates joined by OR.
My table has following indexes : CREATE CUSTOM INDEX master2_fname_contains ON mykeyspace.master2 (fname) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'CONTAINS', 'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive': 'false'}; CREATE CUSTOM INDEX master2_lname_contains ON mykeyspace.master2 (lname) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'CONTAINS', 'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive': 'false'};
Executing below queries results in error
cqlsh> SELECT * FROM mykeyspace.master2 WHERE fname = 'moki' OR fname = 'Shreya' ALLOW FILTERING; SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:56 missing EOF at 'OR' (...master2 WHERE fname = 'bhargav' [OR] fname...)">
cqlsh> SELECT * FROM mykeyspace.master2 WHERE fname LIKE '%arg%' OR fname LIKE '%ey%' ; SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:57 missing EOF at 'OR' (...master2 WHERE fname LIKE '%arg%' [OR] fname...)">
We are using latest cassandra 3.5.0. Could you suggest what am I doing wrong here?
Thanks!
Hi @makailol, OR support hasn't yet been ported to 3.x (I'm working on it in context of CASSANDRA-10765). You can test it out in 2.0 release I have attached in the downloads section, it's fully featured.
Hi - do you have any timeframe in mind for OR support in Cassandra 3.5.0? Many thanks!
Hi! The changes are actually more involved then I thought, I'm currently working on porting query plan to 3.x so I think it's only reasonable to expect OR to land somewhere in 3.1x releases...
Hi! Thanks for the prompt response. What would that translate to calendar-wise (approximately)?
Sorry but it don't really know, it depends on a number of factors, but I hope it's to be done by end of the year.