Skip to content

Instantly share code, notes, and snippets.

@gwicke
Last active September 2, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwicke/35bbce4161852525859b to your computer and use it in GitHub Desktop.
Save gwicke/35bbce4161852525859b to your computer and use it in GitHub Desktop.
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