cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Yudovin <vla...@winguzone.com>
Subject Re: How do data model a recursive message in Cassandra
Date Thu, 22 Dec 2016 15:23:03 GMT
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 &lt;deshpandeshyla@gmail.com&gt;
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&lt;itemgroupproto&gt; 

 

); 

 

 

 

create type itemgroupproto ( 

 

 id text, 

 

 displayname text, 

 

 itemrelations set&lt;frozen&lt;itemrelationproto&gt;&gt; 

 

); 

 

 

 

create table sessionproto ( 

 

 sessionid text, 

 

 displayname text, 

 

 itemrelations set&lt;frozen&lt;itemrelationproto&gt;, 

 

 primary key (sessionid) 

 

); 







Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message