cassandra-cli:无法强制“allias”;到版本 1 UUID

发布于 2024-12-05 12:54:44 字数 1280 浏览 1 评论 0原文

我正在尝试创建一个以 TimeUUIDType 作为行名称的列族:

create column family users
with column_type = 'Standard'
and comparator = 'TimeUUIDType'
and default_validation_class = 'UTF8Type'
and key_validation_class = 'UTF8Type'
and memtable_operations = 0.290625
and memtable_throughput = 62
and memtable_flush_after = 1440
and rows_cached = 0.0
and row_cache_save_period = 0
and keys_cached = 200000.0
and key_cache_save_period = 14400
and read_repair_chance = 1.0
and gc_grace = 864000
and min_compaction_threshold = 4
and max_compaction_threshold = 32
and replicate_on_write = true
and row_cache_provider = 'ConcurrentLinkedHashCacheProvider'
and column_metadata=[
{column_name: allias, validation_class: UTF8Type, index_type: KEYS, index_name: allias},
{column_name: st_user_id, validation_class: TimeUUIDType, index_type: KEYS, index_name: st_user_id},
{column_name: st_money, validation_class: IntegerType},
{column_name: mail, validation_class: UTF8Type},
{column_name: password, validation_class: UTF8Type},
{column_name: last_visit, validation_class: DateType},
{column_name: registered, validation_class: DateType}
];

但我遇到了异常:

org.apache.cassandra.db.marshal.MarshalException:无法强制 “allias”到版本 1 UUID

我做错了什么?

I'm triyng to create a column family with TimeUUIDType as name of row:

create column family users
with column_type = 'Standard'
and comparator = 'TimeUUIDType'
and default_validation_class = 'UTF8Type'
and key_validation_class = 'UTF8Type'
and memtable_operations = 0.290625
and memtable_throughput = 62
and memtable_flush_after = 1440
and rows_cached = 0.0
and row_cache_save_period = 0
and keys_cached = 200000.0
and key_cache_save_period = 14400
and read_repair_chance = 1.0
and gc_grace = 864000
and min_compaction_threshold = 4
and max_compaction_threshold = 32
and replicate_on_write = true
and row_cache_provider = 'ConcurrentLinkedHashCacheProvider'
and column_metadata=[
{column_name: allias, validation_class: UTF8Type, index_type: KEYS, index_name: allias},
{column_name: st_user_id, validation_class: TimeUUIDType, index_type: KEYS, index_name: st_user_id},
{column_name: st_money, validation_class: IntegerType},
{column_name: mail, validation_class: UTF8Type},
{column_name: password, validation_class: UTF8Type},
{column_name: last_visit, validation_class: DateType},
{column_name: registered, validation_class: DateType}
];

But im getting an exception:

org.apache.cassandra.db.marshal.MarshalException: unable to coerce
'allias' to v ersion 1 UUID

What i am doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

﹉夏雨初晴づ 2024-12-12 12:54:44

列族的比较器属性用于对行内的列进行排序。您正在尝试使用 TimeUUID 比较器,这要求每个列名称都是 TimeUUID 值。

如果您想使用 TimeUUID 作为行键,但使用字符串作为列名称,您可能只想切换这些设置的值,

comparator = 'UTF8Type',
key_validation_class = 'TimeUUIDType'

The comparator property of a column family is used for ordering the columns within a row. You are attempting to use a TimeUUID comparator, which would require that each column name be a TimeUUID value.

If you want to use TimeUUIDs as your row keys, but strings for column names you likely just want to switch the values for those settings,

comparator = 'UTF8Type',
key_validation_class = 'TimeUUIDType'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文