Non frozen collections and user defined types on Cassandra 2.1.8

℡╲_俬逩灬. 提交于 2019-12-04 23:19:31

I am running 2.1.8 and I get the same error message. To fix this, you need the frozen keyword:

 CREATE TABLE user_profiles (
      login text PRIMARY KEY,
      first_name text,
      last_name text,
      email text,
      addresses map<text, frozen <address>>
  );

Frozen is necessary for UDTs (for now) as it serializes them into a single value. A similar, better example for you to follow might be the one in the User Defined Type documentation. Give that a try.

I was getting this message when I mistakenly used "string" instead of "text" in a cassandra map, like:

mymap map<bigint, string> 

I followed this stackoverflow thread from google and I thought this information could save someone a few minutes of their time.

Non-frozen UDTs are not yet supported. The reason for asking the user to explicitly specify this keyword for each UDT is to be able to introduce mutable UDTs in 3.x without breaking existing code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!