cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "graham sanderson (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-7490) Static columns mess up selects with ordering and clustering column ranges
Date Thu, 03 Jul 2014 02:55:25 GMT
graham sanderson created CASSANDRA-7490:
-------------------------------------------

             Summary: Static columns mess up selects with ordering and clustering column ranges
                 Key: CASSANDRA-7490
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7490
             Project: Cassandra
          Issue Type: Bug
          Components: Core
            Reporter: graham sanderson


Starts off ok:
{code}
cqlsh:test> create table test (p text, c text, v text, s text static, PRIMARY KEY (p, c));
cqlsh:test> insert into test (p, c, v, s) values ('p1', 'k1', 'v1', 'sv1');
cqlsh:test> select * from test where p = 'p1';

 p  | c  | s   | v
----+----+-----+----
 p1 | k1 | sv1 | v1

(1 rows)
{code}
But try ordering, and we appear to get the static row instead:
{code}
cqlsh:test> select * from test where p = 'p1' order by c desc;

 p  | c    | s   | v
----+------+-----+------
 p1 | null | sv1 | null

(1 rows)
{code}
Now we add a clustering key range constraint, again works ok:
{code}
cqlsh:test> select * from test where p = 'p1' and c >= 'a';

 p  | c  | s   | v
----+----+-----+----
 p1 | k1 | sv1 | v1

(1 rows)
{code}
But, this causes assertion failure (which has a very nice comment explaining exactly why that
might happen!):
{code}
cqlsh:test> select * from test where p = 'p1' and c >= 'a' order by c desc;
Request did not complete within rpc_timeout.
{code}

Cause:

{code}
java.lang.AssertionError: Added column does not sort as the first column
        at org.apache.cassandra.db.ArrayBackedSortedColumns.addColumn(ArrayBackedSortedColumns.java:115)
        at org.apache.cassandra.db.ColumnFamily.addColumn(ColumnFamily.java:116)
        at org.apache.cassandra.db.ColumnFamily.addIfRelevant(ColumnFamily.java:110)
        at org.apache.cassandra.db.filter.SliceQueryFilter.collectReducedColumns(SliceQueryFilter.java:205)
        at org.apache.cassandra.db.filter.QueryFilter.collateColumns(QueryFilter.java:122)
        at org.apache.cassandra.db.filter.QueryFilter.collateOnDiskAtom(QueryFilter.java:80)
        at org.apache.cassandra.db.filter.QueryFilter.collateOnDiskAtom(QueryFilter.java:72)
        at org.apache.cassandra.db.CollationController.collectAllData(CollationController.java:297)
        at org.apache.cassandra.db.CollationController.getTopLevelColumns(CollationController.java:53)
        at org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(ColumnFamilyStore.java:1547)
        at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1376)
        at org.apache.cassandra.db.Keyspace.getRow(Keyspace.java:333)
        at org.apache.cassandra.db.SliceFromReadCommand.getRow(SliceFromReadCommand.java:65)
        at org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:1363)
        at org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:1927)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
{code}




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message