Hello,
On our Cassandra 1.2.15 test cluster I'm stuck with querying data on one of
our Cassandra tables.
This is the table:
cqlsh> describe table mls.te;
CREATE TABLE te (
period bigint,
tnt_id varint,
evt_id timeuuid,
evt_type varint,
data text,
PRIMARY KEY ((period, tnt_id), evt_id, evt_type)
) WITH COMPACT STORAGE AND
CLUSTERING ORDER BY (evt_id DESC, evt_type ASC) AND
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='tenantevent' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};
Notice that the partition key is a composite one.
Now I will simply do a select all on this table with a limit:
cqlsh> select * from mls.te limit 330;
period | tnt_id | evt_id | evt_type
| data
-------------+------------+--------------------------------------+----------+-------------------------------------------------------------------------------------------------
...
62013120356 | 5 | 3f33f950-5c1b-11e3-bf53-402d20524153 | 0
| {"v":1383387,"s":2052457,"r":95257,"pvs":3610245,"u":"
http://www.example.com"}
62013120356 | 5 | ec15e5d0-5c1a-11e3-bf53-402d20524153 | 0
| {"v":1383387,"s":2052457,"r":95257,"pvs":3610243,"u":"
http://www.example.com"}
62015032164 | 2063819251 | 63d5c920-cfdb-11e4-85e9-000c2981ebb4 | 0
| {"v":1451223,"s":2130306,"r":104667,"u":"http://www.example.com"}
62015032164 | 2063819251 | 111ce010-cfdb-11e4-85e9-000c2981ebb4 | 0
| {"v":1451222,"s":2130305,"r":104769,"u":"http://www.example.com"}
62015032164 | 2063819251 | 105e7210-cfdb-11e4-85e9-000c2981ebb4 | 0
| {"v":1451221,"s":2130304,"r":104769,"u":"http://www.example.com"}
62015061055 | 2147429759 | 35b97470-0f68-11e5-8cc3-000c2981ebb4 | 1
|
{"v":1453821,"s":2134354,"r":105462,"q":"13082ede-0843-47ee-8126-ba3767eae547"}
62015061055 | 2147429759 | 35a0bc50-0f68-11e5-8cc3-000c2981ebb4 | 0
| {"v":1453821,"s":2134354,"r":105462,"u":"http://www.example.com"}
So far so good... Now I will try to query a few of these by using the
composite partition key (period, tnt_id):
cqlsh> select * from mls.te where period=62013120356 and tnt_id=5;
cqlsh> select * from mls.te where period=62015032164 and tnt_id=2063819251;
period | tnt_id | evt_id | evt_type
| data
-------------+------------+--------------------------------------+----------+-------------------------------------------------------------------------------------------------
62015032164 | 2063819251 | 63d5c920-cfdb-11e4-85e9-000c2981ebb4 | 0
| {"v":1451223,"s":2130306,"r":104667,"u":"http://www.example.com"}
62015032164 | 2063819251 | 111ce010-cfdb-11e4-85e9-000c2981ebb4 | 0
| {"v":1451222,"s":2130305,"r":104769,"u":"http://www.example.com"}
62015032164 | 2063819251 | 105e7210-cfdb-11e4-85e9-000c2981ebb4 | 0
| {"v":1451221,"s":2130304,"r":104769,"u":"http://www.example.com"}
As you can see, the last query returned the results as expected (see also
the 'select all' query). However the query "select * from mls.te where
period=62013120356 and tnt_id=5;" does not return anything, I did expect
results, since there are results based on this where clause.
Does anybody know what is going on, or what am I doing wrong?
Thanks!
Ramon Rockx