1
votes

I am trying create table in azure cosmos db (cassandra). my create command is

(
    notifierid text,
    notification_date timeuuid,
    actorid text,
    bucketid text,
    categories set<int>,
    entityactiontype int,
    entityid text,
    entityownerid text,
    entitytype text,
    status int,
    viewedstatus boolean,
    PRIMARY KEY
 (notifierid, notification_date))
 WITH CLUSTERING ORDER BY (notification_date DESC)

when i run this command through dashboard i get this error

"WITH CLUSTERING ORDER BY (notification_date DESC) WITH cosmosdb_provisioned_throughput=400;: {"readyState":4,"responseText":"\"{\\"message\\":\\"line 15:382 no viable alternative at input 'WITH (...nt>,\\n entityactiontype int,\\n entityid text,\\n entityownerid text,\\n
entitytype text,\\n status int,\\n viewedstatus boolean,\\n PRIMARY KEY\\n (notifierid, notification_date))\\n WITH CLUSTERING ORDER BY (notification_date DESC) WITH...)"

1

1 Answers

1
votes

The cassandra api for Cosmos DB isn't 100% compatible. My guess is that the WITH clause is not supported in cosmos db. We found some other anomalies that caused us to switch from the Cassandra API to the more robust documents.