SnappyData snappy-sql PUT INTO 导致错误:spark.sql.execution.id 已设置
Posted
技术标签:
【中文标题】SnappyData snappy-sql PUT INTO 导致错误:spark.sql.execution.id 已设置【英文标题】:SnappyData snappy-sql PUT INTO cause error:spark.sql.execution.id is already set 【发布时间】:2017-04-13 22:50:44 【问题描述】:我在使用 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
语句,如果有人能帮助我解决这个问题,我将不胜感激。在此先感谢:)
【问题讨论】:
您只需要在 put into 语句中提供 table_a 架构 - 所以应该是:snappy> put into table_a (key1, val) select * from table_b; 非常感谢您的回答!它现在可以与提供的 table_a 模式一起使用。还有一点“错误”:snappy_sql 控制台返回消息“插入/更新/删除 0 行”。无论如何,只要它有效,这没什么大不了的:) 【参考方案1】:您只需要在 put into 语句中提供 table_a 架构 - 所以应该是:snappy> put into table_a (key1, val) select * from table_b;
我们将看到“0 行插入/更新/删除”问题可以做些什么。 “放入”有点棘手,因为它可以在一个 DML 中进行插入和更新。
【讨论】:
以上是关于SnappyData snappy-sql PUT INTO 导致错误:spark.sql.execution.id 已设置的主要内容,如果未能解决你的问题,请参考以下文章
Spark 组件在 SnappyData 统一集群模式下位于何处?
DBVisualizer 和 SnappyData 的数据库配置文件?