Queries involving static columns return
null values when the order is reversed.
To illustrate the problem, consider the following table definition:
CREATE TABLE myCF (
x text static,
PRIMARY KEY (a,b)
A simple query showing the table's contents:
cqlsh:myKS> SELECT * FROM myCF ;
a | b | x
one | two | ten
When querying the table with a reversed order on the 2nd column, the static column is returned with a
cqlsh:myKS> SELECT * FROM myCF WHERE a = 'one' ORDER BY b DESC;
a | b | x
one | two | null
The issue is due to a known defect in Cassandra (CASSANDRA-8502).
Static columns are not fetched in a reversed query and requires an additional fetch under the hood.
The defect has been fixed in Cassandra versions 2.0.16, 2.1.6 and 2.2. Upgrade to DSE releases which ship with these versions of Cassandra.
DSE 4.7.1 ships with Cassandra 2.1.8 which includes the fix.
DSE 4.6.8 ships with Cassandra 2.0.16 which also includes the fix.
Defect - [CASSANDRA-8502] "Static columns returning null for pages after first".