Error missing ')' at Oracle NoSQL table creating table

28 views Asked by At

I have the following error when trying to create this 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)))";

Any ideas in how to solve this

1

There are 1 answers

0
Dario On BEST ANSWER

The error message is not clear but your issue is because the shard(...) should be the first thing after primary key (, and , id should come after the shard key.

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