无法从Cassandra检索数据

jnb*_*bdz 10 ubuntu cassandra

退出cli后,我无法从Cassandra中检索数据.当我回去在另一个会话中获取数据时,我收到此错误:

org.apache.cassandra.db.marshal.MarshalException:无法将'jsmith'解析为十六进制字节

列系列似乎也停留在键空间中.

我还将密钥格式更改为ascii(假设用户密钥为ascii;)......并且不会保持设置状态.

有原因吗?到底是怎么回事?

jbe*_*lis 16

所有"假设"命令都是临时的,仅限于单个cli会话.对于那些现在没有坐在cli前面的人,我们指的是:

assume <cf> comparator as <type>;
assume <cf> sub_comparator as <type>;
assume <cf> validator as <type>;
assume <cf> keys as <type>;

Assume one of the attributes (comparator, sub_comparator, validator or keys)
of the given column family match specified type. The specified type will
be used when displaying data returned from the column family.
Run Code Online (Sandbox Code Playgroud)

这些纯粹是客户端.

你想要做的是在ColumnFamily定义中永久记录那些元数据,例如来自自述文件,

create column family Users with comparator=UTF8Type and default_validation_class=UTF8Type and key_validation_class=UTF8Type;
Run Code Online (Sandbox Code Playgroud)

这与"假设"有三种不同:

  1. 它永久记录在卡桑德拉
  2. Cassandra将针对插入的数据强制执行指定的类型
  3. 所有客户端都可以查询和使用此元数据来执行智能操作,而不仅仅是cli

假设主要是作为旧数据集的变通方法,无法更新为使用"真实"服务器端类型.

  • 谢谢你的回答! (2认同)