I have installed Apache Cassandra in a single node cluster. When I build a column family, the data gets partitioned due to the murmur3 partitioner based on the primary keys and the table does not preserve the order of the primary keys. So, the SStable output that I see would be sorted by positions, but the order of the primary keys would have altered.
For my requirement, I do not want the order of the primary keys to be shuffled. So, how do I change the partitioning scheme of Cassandra? I looked into the cassandra.yaml file, but there is no instruction on how to change from the default murmur3 partitioner. Would there be any impact if the default is changed?
This is the table I created:
CREATE TABLE ycsb.expt (
y_id varchar,
field0 varchar,
field1 varchar,
field2 vachar,
PRIMARY KEY (y_id, field0) WITH CLUSTERING ORDER BY (field0 ASC);
After adding data to the table, this is my output when I do "select * from expt"
y_id | field0 | field1 | field2
--------+------------+--------------+------------
user48 | ?O3 :<5[ | *B-0Qa | .
user14 | .J | (=~/0`"4 | 03
user40 | (Uu' | +.0 | ;
user42 | // | ((* | 3O
user8 | , | =Ao3[??< | 4.2(Hm6O
I want this output in the same order that I insert the data and I had inserted in sorted order(Ex: User8,User 14,User40). Despite creating the clustering key, it has shuffled the data around.
How do I ensure that the output is in sorted order for the table above?