You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Pulkit Bhuwalka (JIRA)" <ji...@apache.org> on 2014/09/28 23:36:33 UTC
[jira] [Commented] (SPARK-1040) Collect as Map throws a casting
exception when run on a JavaPairRDD object
[ https://issues.apache.org/jira/browse/SPARK-1040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14151231#comment-14151231 ]
Pulkit Bhuwalka commented on SPARK-1040:
----------------------------------------
The github link above is not funcitonal anymore.
> Collect as Map throws a casting exception when run on a JavaPairRDD object
> --------------------------------------------------------------------------
>
> Key: SPARK-1040
> URL: https://issues.apache.org/jira/browse/SPARK-1040
> Project: Spark
> Issue Type: Bug
> Components: Java API
> Affects Versions: 0.9.0
> Reporter: Kevin Mader
> Assignee: Josh Rosen
> Priority: Minor
> Fix For: 0.9.1
>
>
> The error that arises
> {code}
> 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)
> {code}
> The code being executed
> {code:java}
> public static String ImageSummary(final JavaPairRDD<Integer,int[]> inImg) {
> final Set<Integer> keyList=inImg.collectAsMap().keySet();
> for(Integer cVal: keyList) outString+=cVal+",";
> return outString;
> }
> {code}
> The line 426-427 from PairRDDFunctions.scala
> {code:java}
> def collectAsMap(): Map[K, V] = {
> val data = self.toArray()
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org