Skip to content

Instantly share code, notes, and snippets.

@natbusa
Last active December 24, 2015 13:49
Show Gist options
  • Save natbusa/6808457 to your computer and use it in GitHub Desktop.
Save natbusa/6808457 to your computer and use it in GitHub Desktop.
# the following will work (followed_id,follower_id is a partition key)#
cqlsh:test> select * from followers where followed_id='123' and follower_id='567';
followed_id | follower_id | created | likes_count | messages_count
-------------+-------------+--------------------------+-------------+----------------
123 | 567 | 2011-02-03 05:05:00+0100 | 5 | 2
# the following will not work (followed_id,follower_id is a partition key)#
cqlsh:test> select * from followers where followed_id='123' and follower_id>'500';
Bad Request: Only EQ and IN relation are supported on the partition key
(you will need to use the token() function for non equality based relation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment