且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Cassandra:将新列添加到表中

更新时间:2022-04-04 18:50:12

您遇到了 CASSANDRA-6276 。问题是,当您在Cassandra中删除一列时,该列中的数据不仅会消失,而且Cassandra可能会尝试使用其新的比较器类型读取该数据。

You're running into CASSANDRA-6276. The problem is when you drop a column in Cassandra that the data in that column doesn't just disappear, and Cassandra may attempt to read that data with its new comparator type.

从链接的JIRA故障单中:

From the linked JIRA ticket:


不幸的是,我们不允许从比较器中删除组件,包括从ColumnToCollectionType中删除单个集合列。
如果我们允许的话,并且拥有该类型的预先存在的数据,C *根本不知道如何比较这些数据。

Unfortunately, we can't allow dropping a component from the comparator, including dropping individual collection columns from ColumnToCollectionType. If we do allow that, and have pre-existing data of that type, C* simply wouldn't know how to compare those...

。 ..即使我们这样做了,并且允许[用户]创建一个具有相同名称的不同集合,我们也会遇到一个不同的问题:新集合的比较器将用于比较潜在的不兼容类型。

...even if we did, and allowed [users] to create a different collection with the same name, we'd hit a different issue: the new collection's comparator would be used to compare potentially incompatible types.

JIRA建议在Cassandra 3.x中这可能不是问题,但我只是在3.0.3中尝试过,但由于相同的错误而失败。 / p>

The JIRA suggests that this may not be an issue in Cassandra 3.x, but I just tried it in 3.0.3 and it fails with the same error.


我做错了什么?我是Cassandra的新手。有任何建议吗?

What did I do wrong? I am pretty new to Cassandra. Any suggestions?

不幸的是,解决这个问题的唯一方法是为新列表使用不同的名称。

Unfortunately, the only way around this one is to use a different name for your new list.