admin

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

sql

我正在使用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-13​​747 (SQL中的并发执行不适用于Scala
ForkJoinPool)似乎是Spark 2.2.0中修复的错误。

这可能是由于SnappyData仍在使用spark 2.0(至少现在在github上它说已转移到spark 2.0)。但我不确定。

现在,我尽可能尝试使用PUT INTOSnappyData中的语句,如果有人可以帮助我解决此问题,将不胜感激。提前致谢 :)


阅读 447

收藏
2021-07-01

共1个答案

admin

您只需要在put语句中提供table_a模式-因此应该是:snappy>放在table_a中(key1,val)select * from table_b;

我们将看到“ 0行插入/更新/删除”问题的解决方法。“放入”并不是一件容易的事,因为它可以在一个DML中进行插入和更新。

2021-07-01