idea连接spark集群报错解析:Caused by: java.lang.ClassCastException

Posted 哈哈乐178

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了idea连接spark集群报错解析:Caused by: java.lang.ClassCastException相关的知识,希望对你有一定的参考价值。

cannot assign instance of scala.collection.immutable.List$SerializationProxy to field org.apache.spark.sql.execution.aggregate.SortAggregateExec.aggregateExpressions of type scala.collection.Seq in instance of org.apache.spark.sql.execution.aggregate.SortAggregateExec
Exception in thread "main" org.apache.spark.SparkException: Job aborted due to stage failure: Task 8 in stage 4.0 failed 4 times, most recent failure: Lost task 8.3 in stage 4.0 (TID 332, 172.16.43.200, executor 1): java.lang.ClassCastException: cannot assign instance of scala.collection.immutable.List$SerializationProxy to field org.apache.spark.sql.execution.aggregate.SortAggregateExec.aggregateExpressions of type scala.collection.Seq in instance of org.apache.spark.sql.execution.aggregate.SortAggregateExec

  当只指定了spark集群的地址,没有设定setJars这个参数,那么就会报以上这种错误,解决方法就是设置setjars这个参数,如下:

System.setProperty("hadoop.home.dir", "E:\winutils")
    val conf = new SparkConf().setAppName("DetailRatio")
      .setMaster("spark://172.xx.xx.xx:7077")
   // .setMaster("local")
     .setJars(List("E:\vense_work\venseData\out\artifacts\DetailRatio_jar\venseData.jar"))
    //.set("spark.submit.deployMode", "client")

  

以上是关于idea连接spark集群报错解析:Caused by: java.lang.ClassCastException的主要内容,如果未能解决你的问题,请参考以下文章

idea异常idea中下载maven源码报错:Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1(代

解决spark程序报错:Caused by: java.util.concurrent.TimeoutException: Futures timed out after [300 seconds](

Java连接Spark Standalone集群

连接mysql报错Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zon

连接mysql报错Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zon

用idea调试Spark独立集群