[ https://issues.apache.org/jira/browse/CASSANDRA-11133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Yaskevich reassigned CASSANDRA-11133: ------------------------------------------- Assignee: Pavel Yaskevich > [SASI Pre-QA] Creating SPARSE index with Analyzer fails silently when using = > ----------------------------------------------------------------------------- > > Key: CASSANDRA-11133 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11133 > Project: Cassandra > Issue Type: Bug > Components: CQL > Environment: Tested from build > [CASSANDRA-11067|https://issues.apache.org/jira/browse/CASSANDRA-11067] > Reporter: DOAN DuyHai > Assignee: Pavel Yaskevich > > Tested from build > [CASSANDRA-11067|https://issues.apache.org/jira/browse/CASSANDRA-11067] > {code:sql} > CREATE KEYSPACE music WITH replication = {'class': 'SimpleStrategy', > 'replication_factor': '1'} AND durable_writes = true; > CREATE TABLE music.albums ( > id int PRIMARY KEY, > artist text, > title text, > year int > ); > INSERT INTO music.albums(id, artist, title, year) > VALUES (1, 'Bullets and Octane', 'In the Mouth of the Young', 2006); > INSERT INTO music.albums(id, artist, title, year) > VALUES (2, 'Quantic', 'Look Around The Corner', 2012); > INSERT INTO music.albums(id, artist, title, year) > VALUES (3, 'America', 'View From the Ground', 1982); > CREATE CUSTOM INDEX ON music.albums (year) USING > 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'SPARSE', > 'analyzer_class': > 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer'}; > SELECT artist,title,year FROM music.albums; > artist | title | year > -------------------+----------------------------+------ > Bullets and Octane | In the Mouth of the Young | 2006 > Quantic | Look Around the Corner | 2012 > America | View From the Ground | 1982 > {code} > The index was properly created. It can be found calling *DESCRIBE TABLE > albums;* as well as in *system_schema.indexes*. > Strangely, the index does not return any data: > {code:sql} > SELECT * FROM music.albums WHERE year=2006; > (0 rows) > {code} > However range query using the index fails with a cryptic exception: > {code:sql} > SELECT * FROM music.albums WHERE year>=1981 AND year<=1990 LIMIT 10; > Traceback (most recent call last): > File "/opt/apps/apache-cassandra-3.4/bin/cqlsh.py", line 1250, in > perform_simple_statement > result = future.result() > File > "/opt/apps/apache-cassandra-3.4/bin/../lib/cassandra-driver-internal-only-3.0.0-6af642d.zip/cassandra-driver-3.0.0-6af642d/cassandra/cluster.py", > line 3122, in result > raise self._final_exception > ReadFailure: code=1300 [Replica(s) failed to execute read] > message="Operation failed - received 0 responses and 1 failures" > info={'failures': 1, 'received_responses': 0, 'required_responses': 1, > 'consistency': 'ONE'} > {code} > The real exception message in _/var/log/cassandra/system.log_ is: > {code} > Caused by: java.lang.IllegalArgumentException: null > at > org.apache.cassandra.index.sasi.memory.SkipListMemIndex.search(SkipListMemIndex.java:75) > ~[main/:na] > at > org.apache.cassandra.index.sasi.memory.IndexMemtable.search(IndexMemtable.java:69) > ~[main/:na] > at > org.apache.cassandra.index.sasi.conf.ColumnIndex.searchMemtable(ColumnIndex.java:107) > ~[main/:na] > at > org.apache.cassandra.index.sasi.TermIterator.build(TermIterator.java:87) > ~[main/:na] > at > org.apache.cassandra.index.sasi.plan.QueryController.getIndexes(QueryController.java:146) > ~[main/:na] > at > org.apache.cassandra.index.sasi.plan.Operation$Builder.complete(Operation.java:423) > ~[main/:na] > at > org.apache.cassandra.index.sasi.plan.QueryPlan.analyze(QueryPlan.java:57) > ~[main/:na] > at > org.apache.cassandra.index.sasi.plan.QueryPlan.execute(QueryPlan.java:68) > ~[main/:na] > at > org.apache.cassandra.index.sasi.SASIIndex.lambda$searcherFor$241(SASIIndex.java:256) > ~[main/:na] > at > org.apache.cassandra.index.sasi.SASIIndex$$Lambda$248/1287847768.search(Unknown > Source) ~[na:na] > at > org.apache.cassandra.db.ReadCommand.executeLocally(ReadCommand.java:354) > ~[main/:na] > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)