如何查看spark集群上的scala版本号是多少?

提问者:帅平 问题分类:大数据

向spark集群提交任务的时候,提示:

Caused by: java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;
        at org.example.WordCount$$anonfun.apply(WordCount.scala:16)
        at org.example.WordCount$$anonfun.apply(WordCount.scala:16)
        at scala.collection.Iterator$$anon.nextCur(Iterator.scala:486)
        at scala.collection.Iterator$$anon.hasNext(Iterator.scala:492)
        at scala.collection.Iterator$$anon.hasNext(Iterator.scala:460)
        at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:197)
        at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)
        at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:99)
        at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:52)
        at org.apache.spark.scheduler.Task.run(Task.scala:136)
        at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run(Executor.scala:548)
        at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1504)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:551)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)

根据经验来看,spark本地应用程序打包的scala版本和服务器spark集群版本不一致,因此需要修改本地打包的scala版本号,那么如何查看spark集群上的scala版本号是多少?

1 个回答
为什么放弃治疗
为什么放弃治疗

进入到spark集群,执行

./spark-shell

即可看到对应的scala版本号

发布于:2个月前 (12-02)
我来回答