Re: How do data model a recursive message in Cassandra

2016-12-22 Thread Vladimir Yudovin
Hi,



it's better to send such questions to user list, not dev.



Best regards, Vladimir Yudovin, 

Winguzone - Cloud Cassandra Hosting






 On Wed, 21 Dec 2016 17:25:07 -0500 shyla deshpande 
 wrote 




Hi All, 

 

The protobuf message 'sessionproto' that I receive has a field that is 

recursive. How do I define a data model in Cassandra to store this 

data. itemrelationproto 

references itemgroupproto and itemgroupproto references itemrelationproto . 

Thanks. 

 

message itemrelationproto { 

 

 optional string id = 1; 

 

 optional itemgroupproto itemgroup = 2; 

 

} 

 

 

 

message itemgroupproto { 

 

 optional string id = 1; 

 

 optional string displayname = 2; 

 

 repeated itemrelationproto itemrelations = 3; 

 

} 

 

 

 

message sessionproto { 

 

 optional string sessionid = 1; 

 

 optional string displayname = 3; 

 

 repeated itemrelationproto itemrelations = 4; 

 

} 

 

 

create type itemrelationproto ( 

 

 id text, 

 

 itemgroup frozen 

 

); 

 

 

 

create type itemgroupproto ( 

 

 id text, 

 

 displayname text, 

 

 itemrelations set> 

 

); 

 

 

 

create table sessionproto ( 

 

 sessionid text, 

 

 displayname text, 

 

 itemrelations set, 

 

 primary key (sessionid) 

 

); 








How do data model a recursive message in Cassandra

2016-12-21 Thread shyla deshpande
Hi All,

The protobuf message 'sessionproto'  that I receive has a field that is
recursive. How do I define a data model in Cassandra to store this
data. itemrelationproto
references itemgroupproto and itemgroupproto references itemrelationproto .
Thanks.

message itemrelationproto {

optional string id = 1;

optional itemgroupproto itemgroup = 2;

}



message itemgroupproto {

optional string id = 1;

optional string displayname = 2;

repeated itemrelationproto itemrelations = 3;

}



message sessionproto {

optional string sessionid = 1;

optional string displayname = 3;

repeated itemrelationproto itemrelations = 4;

}


create type itemrelationproto (

 id text,

 itemgroup frozen

);



create type itemgroupproto (

 id text,

 displayname text,

 itemrelations set>

);



create table sessionproto (

 sessionid text,

 displayname text,

 itemrelations set,

 primary key (sessionid)

);