Search in sources :

Example 1 with ReversedType

use of org.apache.cassandra.db.marshal.ReversedType in project cassandra by apache.

the class AbstractClusteringIndexFilter method appendOrderByToCQLString.

protected void appendOrderByToCQLString(TableMetadata metadata, StringBuilder sb) {
    if (reversed) {
        sb.append(" ORDER BY ");
        int i = 0;
        for (ColumnMetadata column : metadata.clusteringColumns()) {
            sb.append(i++ == 0 ? "" : ", ").append(column.name.toCQLString()).append(column.type instanceof ReversedType ? " ASC" : " DESC");
        }
    }
}
Also used : ColumnMetadata(org.apache.cassandra.schema.ColumnMetadata) ReversedType(org.apache.cassandra.db.marshal.ReversedType)

Aggregations

ReversedType (org.apache.cassandra.db.marshal.ReversedType)1 ColumnMetadata (org.apache.cassandra.schema.ColumnMetadata)1