IgniteRDD.sql支持哪种SQL

时间:2016-12-07 09:17:28

标签: apache-spark ignite

看起来IgniteRDD.sql只支持ANSI SQL,而不支持SparkSQL或HiveQL?

当我使用IgniteRDD.sql(sqlText)抛出错误的sql异常时,它会追溯到org.h2.jdbc.JdbcSQLException,这意味着h2 parse正在削减sql?

我的理解是否正确?

Exception in thread "main" javax.cache.CacheException: Failed to parse query: select __VAL from Integer
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:1137)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:732)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:730)
    at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:1666)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:730)
    at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:700)
    at org.apache.ignite.spark.IgniteRDD.sql(IgniteRDD.scala:147)
    at com.xyz.ignite.spark.IgniteSparkTest$.main(IgniteSparkTest.scala:33)
    at com.xyz.ignite.spark.IgniteSparkTest.main(IgniteSparkTest.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:613)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.h2.jdbc.JdbcSQLException: Column "__VAL" not found; SQL statement:
select __VAL from Integer [42122-191]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
    at org.h2.message.DbException.get(DbException.java:179)
    at org.h2.message.DbException.get(DbException.java:155)
    at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:147)
    at org.h2.command.dml.Select.prepare(Select.java:852)
    at org.h2.command.Parser.prepareCommand(Parser.java:257)

1 个答案:

答案 0 :(得分:1)

IgniteRDD.sql和objectSql不能在Spark SQL的顶层工作 - 他们只是调用Ignite的SQL引擎。

Here是带有可能说明的文件