无法在Apache Ignite

时间:2017-08-07 08:00:26

标签: ignite

我正在尝试使用以下语法在Apache Ignite上创建视图:

emplCache.query(new SqlFieldsQuery(
            "CREATE VIEW EmployeeCopy AS (SELECT * FROM Employee);")).getAll();

(假设表Employee可用并且其中包含数据)。 当这一行被执行时,我得到以下异常:

javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: null
at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:1823)
at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:795)
at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:765)
at com.demo.ignite.test1.EmployeeQuery2.createCopyTable(EmployeeQuery2.java:71)
at com.demo.ignite.test1.EmployeeQuery2.main(EmployeeQuery2.java:55)
Caused by: class org.apache.ignite.IgniteCheckedException: null
at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2316)
at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:1820)
... 4 more
Caused by: java.lang.NullPointerException
at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1343)
at org.apache.ignite.internal.processors.query.GridQueryProcessor$5.applyx(GridQueryProcessor.java:1815)
at org.apache.ignite.internal.processors.query.GridQueryProcessor$5.applyx(GridQueryProcessor.java:1813)
at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2293)
... 5 more

我看到变量" twoStepQry"在IgniteH2Indexing.java类的第1343行为null。我无法理解我是否错过了什么。

我正在使用apache-ignite-2.1.0。

另外,如果我创建一个VIEW,它在内部如何工作?它是否锁定缓存中的那些条目,还是将其复制到其他缓存中?

1 个答案:

答案 0 :(得分:1)

Ignite目前不支持CREATE VIEW。 我为此创建了一张票:here

支持的DDL语句列表可在https://issues.apache.org/jira/browse/IGNITE-5951

找到