cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clint Kelly <>
Subject CQL: Any way to have inequalities on multiple clustering columns in a WHERE clause?
Date Fri, 28 Feb 2014 05:57:30 GMT

Is there any way to have inequalities comparisons on multiple clustering
columns in a WHERE clause in CQL?  For example, I'd like to do:

select * from foo where fam = 'Info' and qual > 'A' and qual < 'D' and
version > 2013 ALLOW FILTERING;

I get an error:

    Bad Request: PRIMARY KEY part version cannot be restricted (preceding
part qual is either not restricted or by a non-EQ relation)

when I try this.  Is there any way to make a query like this work?  I
understand that this query will not be a nice, continuous scan of data, but
I'd rather have a slower query than have to do all of this filtering on the
client side.  Any other suggestions?

BTW my table looks like this:

  key text,
  fam text,
  qual text,
  version int,
  val text,
  PRIMARY KEY (key, fam, qual, version)
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  index_interval=128 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  default_time_to_live=0 AND
  speculative_retry='99.0PERCENTILE' AND
  memtable_flush_period_in_ms=0 AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'LZ4Compressor'};

Best regards,

View raw message