Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to solve the errors caused by various serialization in big data

Shulou Source: shulou.com Published: 2022-05-31 22:07:56 09月22日 Update

This article shows you how to solve all kinds of serialization errors in big data. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

What kind of serialization will you see that causes an error?

Use client mode to submit spark jobs and observe the locally printed log. If there is an error log with words like Serializable, Serialize, and so on, congratulations, you will encounter an error caused by a serialization problem. Although it is an error report, serialization should be relatively simple and easy to deal with.

Serialization error reporting points to pay attention to:

If an external custom type variable is used in your operator function, then your custom type must be serializable at this point.

Final Teacher teacher = new Teacher ("SET"); studentsRDD.foreach (new VoidFunction () {public void call (Row row) throws Exception {String teacherName = teacher.getName ();. }}); public class Teacher implements Serializable {}

If you want to use a custom type as an element type of RDD, then the custom type must also be serializable

JavaPairRDD teacherRDDJavaPairRDD studentRDDstudentRDD.join (teacherRDD) public class Teacher implements Serializable {} public class Student implements Serializable {} the above content is how to solve the errors caused by various serialization in big data. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Sequences types data errors content skills knowledge conciseness brevity elements functions variables words namely articles more patterns operators articles industries Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info Huawei Shulou Technology Xiaomi