Database Reference
In-Depth Information
cqlsh:demo_cql> CREATE TABLE customer (id int PRIMARY KEY,
name varchar, addr address);
code=2200 [Invalid query] message="Non-frozen User-Defined
types are not supported, please use frozen<>"
cqlsh:demo_cql> CREATE TABLE customer (id int PRIMARY KEY,
name varchar, addr frozen<address>);
cqlsh:demo_cql> CREATE TABLE purchase_ability(id int
PRIMARY KEY, customer_id int, purchase_rating tuple<float,
float, int, boolean>);
code=2200 [Invalid query] message="Non-frozen tuples are
not supported, please use frozen<>"
cqlsh:demo_cql> CREATE TABLE purchase_ability(id int
PRIMARY KEY, customer_id int, purchase_rating
frozen<tuple<float, float, int, boolean>>);
You can specify a non-clustering column as static and this column stays static across all
the rows with the same partition key (row key). This only applies to the columns not in-
volved in compound key. The static column does not make sense in a setting where you
do not have a compound key because in those cases, you have row key as the primary key
and hence each row lives in a separate partition, so each column is essentially a static
column. Here's an example:
# We wanted to have one university per ID
CREATE TABLE static_col (id int, city varchar, university
varchar static, name varchar, PRIMARY KEY(id, city));
# Insert some data
INSERT INTO static_col (id, city, university, name ) VALUES
( 1, 'Seattle', 'Seattle University', 'Barry Kriple');
INSERT INTO static_col (id, city, university, name ) VALUES
( 2, 'Washington', 'Washington University', 'Rose Byrne');
INSERT INTO static_col (id, city, university, name ) VALUES
Search WWH ::




Custom Search