hadoop writables NotSerializableException with Apache Spark API

后端 未结 2 1577
遥遥无期
遥遥无期 2021-02-08 07:02

Spark Java application throws NotSerializableException on hadoop writables.

public final class myAPP {
  public static void main(String[] args) throws Exception          


        
2条回答
  •  隐瞒了意图╮
    2021-02-08 07:09

    use

    sparkConf.set("spark.kryo.classesToRegister", "org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text")
    

    or you can simply use

    ctx.textFile(args[0]);
    

    to load RDD

提交回复
热议问题