BiozterzCodes
BiozterzCodes

Reputation: 205

Cassandra: missing ')' at '<missing '

tried to create the following table:

    CREATE TABLE customTableSchema(
        id UUID PRIMARY KEY,
        table_id UUID,
        schema text,
        created_at timestamp,
        last_modified_at timestamp,
    );

came up with this error:

SyntaxException: line 4:8 missing ')' at '<missing '

Upvotes: 3

Views: 932

Answers (2)

Manish Khandelwal
Manish Khandelwal

Reputation: 2310

Since "schema" is a reserverd keyword, you cannot use your query in current form. If you intend to use it then you can do it as below

CREATE TABLE customTableSchema(
        id UUID PRIMARY KEY,
        table_id UUID,
        "schema" text,
        created_at timestamp,
        last_modified_at timestamp,
    );

You can refer this page for reserved cql keywords.

Upvotes: 4

Alex Ott
Alex Ott

Reputation: 87319

The schema is reserved keyword in the Cassandra Query Language, so you can't use it (see this table in the docs).

Upvotes: 7

Related Questions