Created
November 21, 2013 11:47
-
-
Save nicolasff/7580252 to your computer and use it in GitHub Desktop.
sample.cql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat sample.cql | |
DROP KEYSPACE yo; | |
CREATE KEYSPACE yo WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1}; | |
USE yo; | |
CREATE TABLE test ( | |
pk text, | |
val crdt('org.apache.cassandra.db.CeilFloorCrdt'), | |
PRIMARY KEY (pk)) | |
WITH compression = {'sstable_compression': ''} | |
; | |
UPDATE test SET val=12.34 WHERE pk = 'expect:12:13'; | |
SELECT * FROM test WHERE pk = 'expect:12:13'; | |
UPDATE test SET val=-12.34 WHERE pk = 'expect:-13:-12'; | |
SELECT * FROM test WHERE pk = 'expect:-13:-12'; | |
$ ./bin/cqlsh < sample.cql | |
pk | val | |
--------------+---------- | |
expect:12:13 | [12, 13] | |
(1 rows) | |
pk | val | |
----------------+------------ | |
expect:-13:-12 | [-13, -12] | |
(1 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment