在 Oracle NoSQL table 创建 table 时缺少 ')' 错误

Error missing ')' at Oracle NoSQL table creating table

我在尝试创建此 table

时遇到以下错误

java.lang.IllegalArgumentException: Error: at (1, 1140) missing ')' at ',', at line 1:1140

"create table if not exists " + TABLE_NAME +
        "(id string, " +
        "subId string, " +
        "startTime timestamp(4), " +
        "timeId string, " +
        "primary key(id, shard(subId, startTime)))";

关于如何解决这个问题的任何想法

错误消息不清楚,但您的问题是因为分片 (...) 应该是主键之后的第一件事 (,并且 id 应该在分片键之后。

"create table if not exists " + TABLE_NAME +
        "(id string, " +
        "subId string, " +
        "startTime timestamp(4), " +
        "timeId string, " +
        "primary key(shard(subId, startTime), id))";