-
-
Save gwicke/35bbce4161852525859b to your computer and use it in GitHub Desktop.
This file contains 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
cqlsh> create keyspace "test" WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; | |
cqlsh> use test; | |
cqlsh:test> create table test ( a text, b text, c text, d text, primary key (a, b)); | |
cqlsh:test> alter table test add s int static; | |
cqlsh:test> describe table test; | |
CREATE TABLE test.test ( | |
a text, | |
b text, | |
c text, | |
d text, | |
s int static, | |
PRIMARY KEY (a, b) | |
) WITH CLUSTERING ORDER BY (b ASC) | |
AND bloom_filter_fp_chance = 0.01 | |
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}' | |
AND comment = '' | |
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'} | |
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'} | |
AND dclocal_read_repair_chance = 0.1 | |
AND default_time_to_live = 0 | |
AND gc_grace_seconds = 864000 | |
AND max_index_interval = 2048 | |
AND memtable_flush_period_in_ms = 0 | |
AND min_index_interval = 128 | |
AND read_repair_chance = 0.0 | |
AND speculative_retry = '99.0PERCENTILE'; | |
cqlsh:test> select * from test; | |
a | b | c | d | s | |
---+---+---+---+--- | |
(0 rows) | |
cqlsh:test> insert into test (a,b,c,d,s) values ('a','b','c','d',0); | |
cqlsh:test> insert into test (a,b,c,d,s) values ('a1','b1','c1','d1',1); | |
cqlsh:test> select * from test; | |
a | b | s | c | d | |
----+----+---+----+---- | |
a | b | 0 | c | d | |
a1 | b1 | 1 | c1 | d1 | |
(2 rows) | |
cqlsh:test> insert into test (a,b,c,d,s) values ('a','b1','c1','d1',1); | |
cqlsh:test> select * from test; | |
a | b | s | c | d | |
----+----+---+----+---- | |
a | b | 1 | c | d | |
a | b1 | 1 | c1 | d1 | |
a1 | b1 | 1 | c1 | d1 | |
(3 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment