Database Reference
In-Depth Information
usersWriter.addColumn(bb,addressType.decompose(new
HashSet<String>()),timestamp);
11.
Next, we can save it:
usersWriter.close();
The preceding command generates the
.db
files under the
data/Cql3Demo/Users
folder.
12.
Now, we need to load the generated
.db
files using
sstablel-
oader
:
$CASSANDRA_HOME/bin/sstableloader -d
localhost data/Cql3Demo/Users/
13.
We can validate the output by issuing the
select
command using
the cql shell (see
Figure 10-3
).
select * from "Users";
Figure 10-3
.
The Users table with three rows
14.
We can also alter the
Users
table and add a column with the data type
of
map
:
alter table "Users" add mapCol
map<text,text>;
15.
We just need to add the
composite
type for map and add map as a
column to the preceding implementation like this:
// map column name
byteBuffer1 =
compositeType.decompose("mapcol");
// map column key