gpt4 book ai didi

Cassandra 有效的列名

转载 作者:行者123 更新时间:2023-12-04 03:39:38 25 4
gpt4 key购买 nike

我正在创建一个适用于 mongo 或 cassandra 的 api,因此我使用“_id”作为列名。

根据文档,这应该是一个有效的名称:

Keyspace, column, and table names created using CQL can only contain alphanumeric and underscore characters. User-defined data type names and field names, user-defined function names, and user-defined aggregate names created using CQL can only contain alphanumeric and underscore characters. If you enter names for these objects using anything other than alphanumeric characters or underscores, Cassandra will issue an invalid syntax message and fail to create the object.



但是,当我运行此语句时:
CREATE TABLE users(_id: bigint, entires: map<timestamp, text>, PRIMARY KEY(_id));

我返回以下错误:
Invalid syntax at line 1, char 20

是否可以在列名中使用下划线?

最佳答案

列名中的下划线?是的。列名以下划线开头?不。

来自 CREATE TABLE documentation :

Valid table names are strings of alphanumeric characters and underscores, which begin with a letter.

关于Cassandra 有效的列名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32126985/

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