gpt4 book ai didi

ubuntu - 无法从 Cassandra 检索数据

转载 作者:太空宇宙 更新时间:2023-11-03 16:44:01 24 4
gpt4 key购买 nike

退出 cli 后,我无法从 Cassandra 检索数据。当我返回到另一个 session 中获取数据时,出现此错误:

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

似乎列族和键空间都保留了。

我还将 key 格式更改为 ascii(假设用户 key 为 ascii;)...而且这也不会保持设置。

有什么原因吗?这是怎么回事?

最佳答案

所有“假设”命令都是临时的,仅限于单个 cli session 。对于那些现在不坐在 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.

这些都是纯粹的客户端

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

create column family Users with comparator=UTF8Type and default_validation_class=UTF8Type and key_validation_class=UTF8Type;

这在 3 个方面不同于“假设”:

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

假设主要是作为旧数据集的解决方法,无法更新为使用“真实”服务器端类型。

关于ubuntu - 无法从 Cassandra 检索数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6208104/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com