首页 > 解决方案 > 创建表中的 azure cosmos db 问题

问题描述

我正在尝试在 azure cosmos db (cassandra) 中创建表。我的创建命令是

(
    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)

当我通过仪表板运行此命令时,我收到此错误

“通过(notification_date DESC)进行聚类排序,使用 cosmosdb_provisioned_throughput=400;:{“readyState”:4,“responseText”:“\”{\\“message\\”:\\“第 15:382 行输入时没有可行的替代方案'WITH (...nt>,\\n entityactiontype int,\\n entityid 文本,\\n entityownerid 文本,\\n
entitytype 文本,\\n 状态 int,\\n 查看状态布尔值,\\n 主键\\n (notifierid, notification_date))\\n WITH CLUSTERING ORDER BY (notification_date DESC) WITH...)"

标签: c#cassandraazure-cosmosdb

解决方案


Cosmos DB 的 cassandra api 不是 100% 兼容的。我的猜测是 cosmos db 不支持 WITH 子句。我们发现了一些其他异常情况,导致我们从 Cassandra API 切换到更强大的文档。


推荐阅读