Custom column type in cassandra: List of arrays

By | July 12, 2018
Questions:

How can I define a table schema for a custom column type, as described below?

I did look at the Datastax documentation for UDTs on frozen types. But, I am not able to apply that to my java code. What changes are required for Cassandra TYPE node, so that I can serialize/deserialize easily?. It should store List of Double arrays in column node.

static class Testf {
        String id;
        String name;
        List<Double[]> nodes;
    }

Table schema:

CREATE TABLE IF NOT EXISTS myks.testf(
id text,
name text,
nodes list<FROZEN<node>>,
PRIMARY KEY (id) );

CREATE TYPE myks.node (
     node map<double>
);
Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *