Database Reference
In-Depth Information
SELECT id, name, phone, WRITETIME(name) FROM demo_insert;
id | name | phone |
writetime(name)
----+-----------------+--------------------------------+------------------
1 | Harry Potter | {'44-234-0495', '44-234-9845'} |
1411919467570135
3 | Ginevra Weasley | null |
2147483647000000
(2 rows)
Note that you cannot use IF NOT EXISTS if you manually set TIMESTAMP .
Collections in CQL
As we have seen in the past, collections use a special pattern. Collections are sort of dy-
namically created columns with a column name either as index (list), or keys (map), or the
value itself (sets). So essentially, unlike tuples or UDTs, they are not serialized into one
cell. Instead, each item lives in its individual cell. And you will see that you can pretty
much do whatever you can do with a cell. Let's quickly go through how collections work.
Lists
Lists are like arrays in JSON. They can have duplicate items:
[item1, item2, …]
You can append to them using the + operator, replace an item either by index or value, and
delete items by index:
# Create a table with a list of integer column
CREATE TABLE list_demo (id int PRIMARY KEY, list_col list
Search WWH ::




Custom Search