Spark Jar版本:2.10-1.4.2.5
我有以下代码,它对spark-cassandra集群(使用spark的dse cassandra)进行了一些基本查询。以下查询大部分时间都有效,但有时代码会抛出异常。
表格结构
id | appname | appinstname | snapdate | evnthour | actor | avg_c001_1w | avg_c001_4w | avg_c001_8w | avg_c002_1w | avg_c002_4w | avg_c002_8w | avg_c003_1w | avg_c003_4w | avg_c003_8w | avg_c004_1w | avg_c004_4w | avg_c004_8w | avg_c005_1w.......avg_c075
使用hivecontext执行查询
select * from (
select *, row_number() over (order by evnthour desc) rn
from testing
where id= '9fcb1' and appname='ABC' and appinstname='dc8cc' and snapdate='2017-12-22' and actor='xyz@gmai.comv
) t1 where rn = 1
错误跟踪
... 41 common frames omitted
at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:48) ~[spark-catalyst_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.execution.Exchange$$anonfun$doExecute$1.apply(Exchange.scala:172) ~[spark-sql_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.execution.Exchange$$anonfun$doExecute$1.apply(Exchange.scala:236) ~[spark-sql_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.execution.Exchange.org$apache$spark$sql$execution$Exchange$$needToCopyObjectsBeforeShuffle(Exchange.scala:89) ~[spark-sql_2.10-1.4.2.5.jar:1.4.2.5]
Caused by: java.lang.NullPointerException: null
... 33 common frames omitted
at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:48) ~[spark-catalyst_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.execution.Sort$$anonfun$doExecute$5.apply(basicOperators.scala:212) ~[spark-sql_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.execution.Sort$$anonfun$doExecute$5.apply(basicOperators.scala:212) ~[spark-sql_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:87) ~[spark-sql_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:147) ~[spark-core_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:88) ~[spark-sql_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:88) ~[spark-sql_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.execution.Exchange.doExecute(Exchange.scala:171) ~[spark-sql_2.10-1.4.2.5.jar:1.4.2.5]
at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:49) ~[spark-catalyst_2.10-1.4.2.5.jar:1.4.2.5]
我无法通过日志跟踪找出此失败的实际原因。有什么建议吗?