gpt4 book ai didi

cassandra - 如何使用 cassandra 表重命名列名称

转载 作者:行者123 更新时间:2023-12-02 22:40:25 25 4
gpt4 key购买 nike

我在 cassandra 数据库中有一个问题。我想重命名列名称。但它显示语法错误。因为我的列名包含空格。那么如何更改列名称:

例如:将示例列转换为示例列

最佳答案

您可以使用alter table来重命名列,但它有很多限制。由于 sstable 是不可变的,为了更改磁盘上的状态,所有内容都必须重写。

The main purpose of RENAME is to change the names of CQL-generated primary key and column names that are missing from a legacy table. The following restrictions apply to the RENAME operation:

  • You can only rename clustering columns, which are part of the primary key.

  • You cannot rename the partition key.

  • You can index a renamed column.

  • You cannot rename a column if an index has been created on it.

  • You cannot rename a static column (since you cannot use a static column in the table's primary key).

https://docs.datastax.com/en/cql/3.1/cql/cql_reference/alter_table_r.html

关于cassandra - 如何使用 cassandra 表重命名列名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46935152/

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