Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

temi avatar image
temi asked Erick Ramirez edited

Error creating table

Hello,

I'm newly created a test database here

I'm trying to send the following json to the REST API (tables endpoint)

{
  "name": "products",
  "ifNotExist": true,
  "columnDefinitions": [
    {
      "name": "id",
      "typeDefinition": "uuid",
      "static": false
    },
    {
      "name": "sku",
      "typeDefinition": "string",
      "static": false
    }
  ],
  "primaryKey": {
    "partitonKey": [
      "id",
      "sku"
    ]
  },
  "tableOptions": {
    "defaultTimeToLive": 0
  }
}

SyntaxException: line 1:86 no viable alternative at input ')' (...sku string, PRIMARY KEY ([)]...) unfortunatly I dont see whats wrong here. Please help!

cql
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

temi avatar image
temi answered

Sorry, figured it out now (missing "i" in "partitionKey") well also wrong typeDefinition "string" (text)

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.