Ignite数据库:创建模式:AssertionError

时间:2018-02-09 14:40:23

标签: sql ignite

我想使用ignite作为内存数据库创建一个模式。所以我做了以下几点:

try (Statement statement = connection.createStatement()) {
    statement.executeQuery("CREATE SCHEMA my_schema");
}

但是我得到了错误:

Exception in thread "sql-connector-#38%null%" java.lang.AssertionError
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1341)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1856)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor$6.applyx(GridQueryProcessor.java:1852)
    at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2293)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFieldsNoCache(GridQueryProcessor.java:1860)
    at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:188)
    at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:122)
    at org.apache.ignite.internal.processors.odbc.SqlListenerNioListener.onMessage(SqlListenerNioListener.java:152)
    at org.apache.ignite.internal.processors.odbc.SqlListenerNioListener.onMessage(SqlListenerNioListener.java:44)
    at org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
    at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
    at org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
    at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
    at org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

我不知道这意味着什么。我需要创建模式,因为即时创建我的sql语句的单元测试,原始表也有一个模式:

my_schema.my_table

我不能仅仅为了单元测试而替换表名。

修改

我必须提到点燃称为架构。在我看来,它只是一个数据库名称。但CREATE DATABASE my_database也不起作用。

1 个答案:

答案 0 :(得分:5)

目前Ignite尚不支持命令CREATE SCHEMA

如果您创建了几个缓存,则会为每个缓存分配一个具有匹配名称的自己的架构。还有一个名为PUBLIC的模式,其中使用命令CREATE TABLE创建所有缓存。

Ignite中当前可用的DDL命令的子集在此处描述:

https://apacheignite-sql.readme.io/docs/ddl