Oracle NoSQL - 什么意思:Table 存在但定义不匹配

Oracle NoSQL - what does mean : Table exists but definitions do not match

我运行进入这个问题:

Caused by: java.lang.IllegalArgumentException: 
Error: User error in query: 
CREATE TABLE failed for table TEST: 
Table exists but definitions do not match

我使用控制台在现有数据库中添加了 2 个新列,并将它们添加到 table 创建语句中。当我 运行 再次创建 table 时出现错误。 我检查了所有内容,它们都匹配,(名称,类型...)

创建 table 时,列的顺序很重要。你验证了吗? CREATE TABLE 子句中的 IF NOT EXISTS 检查 table 的相同结构。更多内容请参考以下文档 details.https://docs.oracle.com/en/database/other-databases/nosql-database/21.1/sqlreferencefornosql/create-table.html

这通知您您尝试创建的 table 退出但结构不一样。可能会有用。

更改列顺序时显示错误的示例:

sql-> CREATE TABLE IF NOT EXISTS testing_tbl(id INTEGER, firstName STRING,
    lastName STRING,
PRIMARY KEY (id));

Statement completed successfully

sql-> CREATE TABLE IF NOT EXISTS testing_tbl(id INTEGER, firstName STRING,

    lastName STRING,

PRIMARY KEY (id));

Statement did not require execution

sql-> CREATE TABLE IF NOT EXISTS testing_tbl(id INTEGER, lastName STRING,
firstName STRING,
PRIMARY KEY (id));


Error handling command CREATE TABLE IF NOT EXISTS testing_tbl(id INTEGER,
    lastName STRING,
firstName STRING,
PRIMARY KEY (id)): Error: User error in query: CREATE TABLE failed for table testing_tbl: Table exists but definitions do not match