BAGEL RESULT : HOW TO PRINT + ERROR SHOWS IN THE TUPLE 2

26 views
Skip to first unread message

Johnpaul Ci

unread,
Apr 2, 2013, 3:47:46 AM4/2/13
to spark...@googlegroups.com
Hi all

When I tried to print out the result of bagel.run through the result variable, It shows the following error .
What will be its cause ? . I had tried to solve this by changing the type of the result parameters. Still it is the same error.




java.lang.ClassCastException: scala.Tuple2 cannot be cast to spark.bagel.examples.GraphGenVertex
    at spark.bagel.examples.GraphGeneration$$anonfun$main$3.apply(GraphGeneration.scala:63)
    at spark.bagel.examples.GraphGeneration$$anonfun$main$3.apply(GraphGeneration.scala:63)

    at scala.collection.Iterator$$anon$19.next(Iterator.scala:401)
    at scala.collection.Iterator$class.foreach(Iterator.scala:772)
    at scala.collection.Iterator$$anon$19.foreach(Iterator.scala:399)
    at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
    at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:102)
    at scala.collection.TraversableOnce$class.toBuffer(TraversableOnce.scala:250)
    at scala.collection.Iterator$$anon$19.toBuffer(Iterator.scala:399)
    at scala.collection.TraversableOnce$class.toArray(TraversableOnce.scala:237)
    at scala.collection.Iterator$$anon$19.toArray(Iterator.scala:399)
    at spark.RDD$$anonfun$1.apply(RDD.scala:389)
    at spark.RDD$$anonfun$1.apply(RDD.scala:389)
Exception in thread "main" spark.SparkException: Job failed: ResultTask(24, 0) failed: ExceptionFailure(java.lang.ClassCastException: scala.Tuple2 cannot be cast to spark.bagel.examples.GraphGenVertex)

    at spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:629)
    at spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:627)
    at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    at spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:627)
    at spark.scheduler.DAGScheduler.handleTaskCompletion(DAGScheduler.scala:588)
    at spark.scheduler.DAGScheduler.processEvent(DAGScheduler.scala:294)
    at spark.scheduler.DAGScheduler.spark$scheduler$DAGScheduler$$run(DAGScheduler.scala:358)
    at spark.scheduler.DAGScheduler$$anon$1.run(DAGScheduler.scala:102)

My portion of the code where this error happens is as follows.

val result = Bagel.run(sc,verts,emptyMsgs,2)(compute)
 
 65    println(result.map(v => "%s\t%s\n".format(v.asInstanceOf[GraphGenVertex].    id, v.asInstanceOf[GraphGenVertex].rank)).collect.mkString)

regards
John
Reply all
Reply to author
Forward
0 new messages