gpt4 book ai didi

scala - Spark 在 Hbase 的 InputSplit 期间给出空指针异常

转载 作者:行者123 更新时间:2023-12-04 15:43:26 26 4
gpt4 key购买 nike

我使用的是 Spark 1.2.1、Hbase 0.98.10 和 Hadoop 2.6.0。在从 hbase 检索数据时出现空点异常。
在下面找到堆栈跟踪。

[sparkDriver-akka.actor.default-dispatcher-2] DEBUG NewHadoopRDD - Failed to use InputSplit#getLocationInfo. java.lang.NullPointerException: null at scala.collection.mutable.ArrayOps$ofRef$.length$extension(ArrayOps.scala:114) ~[scala-library-2.10.4.jar:na] at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:114) ~[scala-library-2.10.4.jar:na] at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:32) ~[scala-library-2.10.4.jar:na] at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) ~[scala-library-2.10.4.jar:na] at org.apache.spark.rdd.HadoopRDD$.convertSplitLocationInfo(HadoopRDD.scala:401) ~[spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.rdd.NewHadoopRDD.getPreferredLocations(NewHadoopRDD.scala:215) ~[spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.rdd.RDD$$anonfun$preferredLocations$2.apply(RDD.scala:234) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.rdd.RDD$$anonfun$preferredLocations$2.apply(RDD.scala:234) [spark-core_2.10-1.2.1.jar:1.2.1] at scala.Option.getOrElse(Option.scala:120) [scala-library-2.10.4.jar:na] at org.apache.spark.rdd.RDD.preferredLocations(RDD.scala:233) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal(DAGScheduler.scala:1326) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2$$anonfun$apply$2.apply$mcVI$sp(DAGScheduler.scala:1336) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2$$anonfun$apply$2.apply(DAGScheduler.scala:1335) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2$$anonfun$apply$2.apply(DAGScheduler.scala:1335) [spark-core_2.10-1.2.1.jar:1.2.1] at scala.collection.immutable.List.foreach(List.scala:318) [scala-library-2.10.4.jar:na] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2.apply(DAGScheduler.scala:1335) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2.apply(DAGScheduler.scala:1333) [spark-core_2.10-1.2.1.jar:1.2.1] at scala.collection.immutable.List.foreach(List.scala:318) [scala-library-2.10.4.jar:na] at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal(DAGScheduler.scala:1333) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2$$anonfun$apply$2.apply$mcVI$sp(DAGScheduler.scala:1336) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2$$anonfun$apply$2.apply(DAGScheduler.scala:1335) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2$$anonfun$apply$2.apply(DAGScheduler.scala:1335) [spark-core_2.10-1.2.1.jar:1.2.1] at scala.collection.immutable.List.foreach(List.scala:318) [scala-library-2.10.4.jar:na] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2.apply(DAGScheduler.scala:1335) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal$2.apply(DAGScheduler.scala:1333) [spark-core_2.10-1.2.1.jar:1.2.1] at scala.collection.immutable.List.foreach(List.scala:318) [scala-library-2.10.4.jar:na] at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$getPreferredLocsInternal(DAGScheduler.scala:1333) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler.getPreferredLocs(DAGScheduler.scala:1304) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$17.apply(DAGScheduler.scala:862) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler$$anonfun$17.apply(DAGScheduler.scala:859) [spark-core_2.10-1.2.1.jar:1.2.1] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) [scala-library-2.10.4.jar:na] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) [scala-library-2.10.4.jar:na] at scala.collection.Iterator$class.foreach(Iterator.scala:727) [scala-library-2.10.4.jar:na] at scala.collection.AbstractIterator.foreach(Iterator.scala:1157) [scala-library-2.10.4.jar:na] at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) [scala-library-2.10.4.jar:na] at scala.collection.AbstractIterable.foreach(Iterable.scala:54) [scala-library-2.10.4.jar:na] at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) [scala-library-2.10.4.jar:na] at scala.collection.AbstractTraversable.map(Traversable.scala:105) [scala-library-2.10.4.jar:na] at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$submitMissingTasks(DAGScheduler.scala:859) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$submitStage(DAGScheduler.scala:778) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGScheduler.handleJobSubmitted(DAGScheduler.scala:762) [spark-core_2.10-1.2.1.jar:1.2.1] at org.apache.spark.scheduler.DAGSchedulerEventProcessActor$$anonfun$receive$2.applyOrElse(DAGScheduler.scala:1389) [spark-core_2.10-1.2.1.jar:1.2.1] at akka.actor.Actor$class.aroundReceive(Actor.scala:465) [akka-actor_2.10-2.3.4-spark.jar:na] at org.apache.spark.scheduler.DAGSchedulerEventProcessActor.aroundReceive(DAGScheduler.scala:1375) [spark-core_2.10-1.2.1.jar:1.2.1] at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) [akka-actor_2.10-2.3.4-spark.jar:na] at akka.actor.ActorCell.invoke(ActorCell.scala:487) [akka-actor_2.10-2.3.4-spark.jar:na] at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) [akka-actor_2.10-2.3.4-spark.jar:na] at akka.dispatch.Mailbox.run(Mailbox.scala:220) [akka-actor_2.10-2.3.4-spark.jar:na] at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) [akka-actor_2.10-2.3.4-spark.jar:na] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.10.4.jar:na] at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.10.4.jar:na] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.10.4.jar:na] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.10.4.jar:na]



请为我提供此问题的解决方案。

最佳答案

在 getPreferredLocations 阶段抛出异常,因此没有关于您的 hbase 配置的更多信息我建议您查看 hbase.table.name 和 hbase.master(如果正确定义 HMaster,我不这样做最后一个)配置为您想

关于scala - Spark 在 Hbase 的 InputSplit 期间给出空指针异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28493991/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com