SnappyData snappy-sql PUT INTO导致错误:spark.sql.execution.id已设置

时间:2017-04-13 22:50:44

标签: sql snappydata

我正在使用SnappyData SQL shell(snappy-sql)并运行sql语句(PUT INTO)并遇到错误:

ERROR 38000: (SQLState=38000 Severity=20000) (Server=localhost/127.0.0.1[1528] Thread=pool-3-thread-3) The exception 'com.pivotal.gemfirexd.internal.engine.jdbc.GemFireXDRuntimeException: myID: s4-03(19442)<v1>:43452, caused by java.lang.IllegalArgumentException: spark.sql.execution.id is already set' was thrown while evaluating an expression.
Caused by: ServerException: Server STACK: java.sql.SQLException(38000): The exception 'com.pivotal.gemfirexd.internal.engine.jdbc.GemFireXDRuntimeException: myID: s4-03(19442)<v1>:43452, caused by java.lang.IllegalArgumentException: spark.sql.execution.id is already set' was thrown while evaluating an expression.
    at com.pivotal.gemfirexd.internal.iapi.error.StandardException.newException(StandardException.java:473)
    at com.pivotal.gemfirexd.internal.engine.Misc.processFunctionException(Misc.java:808)
    at com.pivotal.gemfirexd.internal.engine.Misc.processFunctionException(Misc.java:753)
    at com.pivotal.gemfirexd.internal.engine.sql.execute.SnappySelectResultSet.setup(SnappySelectResultSet.java:282)
    at com.pivotal.gemfirexd.internal.engine.distributed.message.GfxdFunctionMessage.e

xecuteFunction(GfxdFunctionMessage.java:332)
        at com.pivotal.gemfirexd.internal.engine.distributed.message.GfxdFunctionMessage.executeFunction(GfxdFunctionMessage.
(truncated for brevity.)

这就是我所做的: 从https://www.snappydata.io/download(v0.8)下载SnappyData二进制文件。 解压缩,运行

sbin/snappy-start-all.sh
bin/snappy-sql
snappy> connect client 'localhost:1527';

snappy> create table table_a(key1 INT primary key, val INT);

snappy> create table table_b(key1 INT primary key, val INT);

snappy> insert into table_a values (1, 1);

snappy> insert into table_b values (1, 2);

snappy> insert into table_b values (2, 3);

snappy> select * from table_a;
KEY1       |VAL        
-----------------------
1          |1          

1 row selected
snappy> select * from table_b;
KEY1       |VAL        
-----------------------
2          |3          
1          |2          

2 rows selected

snappy> put into table_a select * from table_b;
(then the above error.)

搜索错误(已设置spark.sql.execution.id)导致此处: https://issues.apache.org/jira/browse/SPARK-13747 (SQL中的并发执行不适用于Scala ForkJoinPool),这似乎是Spark 2.2.0中修复的错误。

这可能是因为SnappyData仍然使用spark 2.0(至少现在在github中它表示转向了spark 2.0)。但我不确定。

现在我尝试使用SnappyData中的PUT INTO语句,如果有人可以帮我解决这个问题,我们将不胜感激。在此先感谢:)

1 个答案:

答案 0 :(得分:2)

你只需要在put into语句中提供table_a架构 - 所以它应该是:snappy&gt;放入table_a(key1,val)select * from table_b;

我们将看到插入/更新/删除&#39; 0行可以做些什么?问题。 &#39;放入&#39;有点棘手,因为它可以在一个DML中进行插入和更新。