Mulgard
Mulgard

Reputation: 10589

Ignite database: Create schema: AssertionError

I want to create a schema using ignite as an in memory database. So I do the following:

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

But im getting the error:

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)

And I have no idea what that means. I need to create the schema since im creating unit tests for my sql statements and the original table also has a schema:

my_schema.my_table

And I cant replace the table name just for unit test purposes.

EDIT

I have to mention that ignite calls that a schema. In my opinion it is just a database name. but CREATE DATABASE my_database also does not work.

Upvotes: 0

Views: 1997

Answers (1)

Alexander Paschenko
Alexander Paschenko

Reputation: 191

Command CREATE SCHEMA is not supported in Ignite as of yet.

If you create few caches, each of them will be assigned its own schema having a matching name. Also there's a schema named PUBLIC where live all caches created with command CREATE TABLE.

Subset of DDL commands currently available in Ignite is described here:

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

Upvotes: 5

Related Questions