After performing the Create INDEX operation, Cassandra the error:
Java.lang.IllegalArgumentException at Java.nio.Buffer.limit (buffer.java:249) at Org.apache.cassandra.db.marshal.AbstractCompositeType.getBytes (abstractcompositetype.java:51) at Org.apache.cassandra.db.marshal.AbstractCompositeType.getWithShortLength (abstractcompositetype.java:60) at Org.apache.cassandra.db.marshal.AbstractCompositeType.getString (abstractcompositetype.java:140) at Org.apache.cassandra.config.CFMetaData.getDefaultIndexName (cfmetadata.java:875) at Org.apache.cassandra.config.CFMetaData.addDefaultIndexNames (cfmetadata.java:863) at Org.apache.cassandra.cql3.statements.CreateIndexStatement.announceMigration (createindexstatement.java:90) at Org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute (schemaalteringstatement.java:99) at Org.apache.cassandra.cql3.QueryProcessor.processStatement (queryprocessor.java:108) at Org.apache.cassandra.cql3.QueryProcessor.process (queryprocessor.java:121) at Org.apache.cassandra.thrift.CassandraServer.execute_cql_query (Cassandraserver.java:1237) at Org.apache.cassandra.thrift.cassandra$processor$execute_cql_query.getresult (Cassandra.java : 3542) at Org.apache.cassandra.thrift.cassandra$processor$execute_cql_query.getresult (Cassandra.java:3530) at Org.apache.thrift.ProcessFunction.process (processfunction.java:32) at Org.apache.thrift.TBaseProcessor.process ( tbaseprocessor.java:34) at Org.apache.cassandra.thrift.customtthreadpoolserver$workerprocess.run ( customtthreadpoolserver.java:186) at Java.util.concurrent.threadpoolexecutor$worker.runtask ( threadpoolexecutor.java:886) at Java.util.concurrent.threadpoolexecutor$worker.run (ThreadPoolExecutor.java:908) At Java.lang.Thread.run (thread.java:619)
However, this error is not possible if you change the composite primary key to a single primary key.
After a day of thinking, I find it really impossible to build a level two index. I am not very clear on the internal principle of two level index establishment, but refer to Apache Cassandra 1.1 documentation, found that can only use primary key query (is to build several primary key), and the Multiple condition query (except the last one) must use "=" expression. Like this: Build table:
SELECT * from altercations WHERE instigator= ' Jayne Cobb ' and startedat = ' 7943-06-23 ' and shipsdestroyed= ' 3 ' and energyused > ' 4.6 ' ORDER by Startedat DESC;
found that the results of the search is completely confusing, not according to the conditions of the query, as follows:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.