Home > other >  The spark RDD problem for help
The spark RDD problem for help

Time:09-17

HashMap Map1=new HashMap<> (a);
Map1. Put (1100);
Map1. Put (2150);
Map1. Put (3120);
HashMap Map2=new HashMap<> (a);
Map2. Put (2200);
Map2. Put (7, 20);
Map2. Put (3,66);
Number//may still has a lot of the map, uncertainty, and the key value is likely to be repeated
List Mylist=new ArrayList<> (a);

And now I get a sc object, want to do a word count test
JavaRDD Lines=sc. Parallelize (mylist);
Results no instance (s) of the type variable (s) T exist so that List Conforms to Seq
Want to ask how to initialize the data?

CodePudding user response:

Sc. Parallelize request parameters for Seq types, you try the ArrayList replacement for Seq derived classes

CodePudding user response:

reference 1st floor qiongwei response:
sc. Parallelize request parameters for Seq types, you put the ArrayList replaced by Seq derived class try
I only introduced spark project core, and the relationship

CodePudding user response:

Will you perform, an error prompt missing classes, and so on, so to find the corresponding jar to add

CodePudding user response:

Need a hashmap object serialization

CodePudding user response:


It is not convenient for export, the screenshots to see ~ ~ Scala version of the directly, instead of the Java version of the workload is not big, actually sent two times,
  • Related