Description
The error that arises
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lscala.Tuple2; at org.apache.spark.rdd.PairRDDFunctions.collectAsMap(PairRDDFunctions.scala:427) at org.apache.spark.api.java.JavaPairRDD.collectAsMap(JavaPairRDD.scala:409)
The code being executed
public static String ImageSummary(final JavaPairRDD<Integer,int[]> inImg) { final Set<Integer> keyList=inImg.collectAsMap().keySet(); for(Integer cVal: keyList) outString+=cVal+","; return outString; }
The line 426-427 from PairRDDFunctions.scala
def collectAsMap(): Map[K, V] = { val data = self.toArray()
Attachments
Issue Links
- is related to
-
SPARK-4489 JavaPairRDD.collectAsMap from checkpoint RDD may fail with ClassCastException
- Resolved