You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by IPVP <ip...@hotmail.com> on 2015/09/18 04:29:47 UTC
Using UDT Collection to store user aggregated data
Hi all,
Could someone please let me know if the following modeling is on the right way ?
Te requirement is to query by user_id the summarized data of transaction_status_per_user.
-----
### UDT
CREATE TYPE core_analytics.status_summary (
name text,
count int,
hexcolor text
);
### TABLE
CREATE TABLE core_analytics.transaction_status_per_user (
user_id uuid,
statuses LIST<FROZEN<status_summary>>,
PRIMARY KEY (user_id)
);
###Java Mapping
@UDT(keyspace = "core_analytics", name = "status_summary")
public class StatusSummary {
private String name;
private Integer count;
private String hexcolor;
// getters setters omitted
}
-----
Thanks
IP