Github user mateiz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1447#discussion_r15042905
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala 
---
    @@ -571,12 +571,7 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])
           throw new SparkException("Default partitioner cannot partition array 
keys.")
         }
         val cg = new CoGroupedRDD[K](Seq(self, other1, other2, other3), 
partitioner)
    -    cg.mapValues { case Seq(vs, w1s, w2s, w3s) =>
    -      (vs.asInstanceOf[Seq[V]],
    -        w1s.asInstanceOf[Seq[W1]],
    -        w2s.asInstanceOf[Seq[W2]],
    -        w3s.asInstanceOf[Seq[W3]])
    -    }
    +    cg.mapValues { seq  => seq.asInstanceOf[(Seq[V], Seq[W1], Seq[W2], 
Seq[W3])] }
    --- End diff --
    
    And yeah as Reynold pointed out, this won't actually cast. A Seq is not a 
tuple4, you need to make a new one. In this case it might be okay to leave the 
code as is, because the non-pattern-matching way will be hairier. Basically 
you'd have to do `seq => (seq(0).asInstanceOf[Seq[V]], 
seq(1).asInstanceOf[Seq[W1]], etc)`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to