我用SnappyData SQL壳(活泼-SQL)和运行SQL语句(投产),并跑进了错误:SnappyData活泼-SQL投产导致错误:spark.sql.execution.id已经设置
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中修复的一个bug。
这是可能的,这可能是由于SnappyData仍然使用火花2.0(至少现在在GitHub上它说搬到火花2.0)。但我不确定。
现在,我想如果可能的话使用PUT INTO
报表SnappyData,这将不胜感激,如果有人能帮助我解决这个问题。在此先感谢:)
你只需要在put into语句中提供table_a模式 - 所以它应该是:snappy>放入table_a(key1,val)select * from table_b; –
非常感谢的答案!它现在可以使用提供的table_a模式工作。还有一点'错误':snappy_sql控制台返回消息说'0行插入/更新/删除'。无论如何,只要它工作,这不是一个大问题:) – user3230153