问题描述
尝试创建下表:
CREATE TABLE customTableSchema(
id UUID PRIMARY KEY,table_id UUID,schema text,created_at timestamp,last_modified_at timestamp,);
想出了这个错误:
SyntaxException: line 4:8 missing ')' at '<missing '
解决方法
schema
是 Cassandra 查询语言中的保留关键字,因此您不能使用它(请参阅 this table in the docs)。
由于“schema”是一个保留关键字,您不能以当前形式使用您的查询。如果您打算使用它,那么您可以按照以下方式进行
CREATE TABLE customTableSchema(
id UUID PRIMARY KEY,table_id UUID,"schema" text,created_at timestamp,last_modified_at timestamp,);
您可以参考 this page 以获取保留的 cql 关键字。