Database Reference
In-Depth Information
To show how static tables and wide row tables differ in their underlying presentations, we
will use cassandra-cli , a previous generation utility that uses the Thrift protocol to
connect to Cassandra and assumes the column families are just sorted hash maps contain-
ing sorted hash maps.
Here's how you create a static column family:
# Using cqlsh
cqlsh:mastering_cassandra> CREATE TABLE demo_static_cf (id
int PRIMARY KEY, name varchar, age int);
cqlsh:mastering_cassandra> INSERT INTO demo_static_cf (id,
name, age) VALUES ( 1, 'Jennie', 39);
cqlsh:mastering_cassandra> INSERT INTO demo_static_cf (id,
name, age) VALUES ( 2, 'Samantha', 23);
cqlsh:mastering_cassandra> SELECT * FROM demo_static_cf;
id | age | name
----+-----+----------
1 | 39 | Jennie
2 | 23 | Samantha
(2 rows)
This is how it is stored:
# View using cassandra-cli
[default@mastering_cassandra] LIST demo_static_cf;
Using default limit of 100
Using default cell limit of 100
-------------------
RowKey: 1
=> (name=, value=, timestamp=1410338723286000)
=> (name=age, value=00000027, timestamp=1410338723286000)
=> (name=name, value=4a656e6e6965,
timestamp=1410338723286000)
Search WWH ::




Custom Search