spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mateiz <...@git.apache.org>
Subject [GitHub] incubator-spark pull request: [java8API] SPARK-964 Investigate the...
Date Tue, 25 Feb 2014 00:37:40 GMT
Github user mateiz commented on a diff in the pull request:

    https://github.com/apache/incubator-spark/pull/539#discussion_r10019117
  
    --- Diff: core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala ---
    @@ -117,19 +118,19 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends Serializable
{
        *  Return a new RDD by first applying a function to all elements of this
        *  RDD, and then flattening the results.
        */
    -  def flatMap[K2, V2](f: PairFlatMapFunction[T, K2, V2]): JavaPairRDD[K2, V2] = {
    +  def flatMapToPair[K2, V2](f: PairFlatMapFunction[T, K2, V2]): JavaPairRDD[K2, V2] =
{
         import scala.collection.JavaConverters._
    -    def fn = (x: T) => f.apply(x).asScala
    -    val ctag = implicitly[ClassTag[Tuple2[K2, V2]]]
    -    JavaPairRDD.fromRDD(rdd.flatMap(fn)(ctag))(f.keyType(), f.valueType())
    +    def fn = (x: T) => f.call(x).asScala
    +    def cm = implicitly[ClassTag[Tuple2[_, _]]].asInstanceOf[ClassTag[Tuple2[K2, V2]]]
    --- End diff --
    
    Ditto here on the ClassTag


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message