spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zsxwing <>
Subject [GitHub] spark pull request: [SPARK-4397][Core] Reorganize 'implicit's to i...
Date Fri, 14 Nov 2014 07:50:56 GMT
GitHub user zsxwing opened a pull request:

    [SPARK-4397][Core] Reorganize 'implicit's to improve the API convenience

    This PR moved `implicit`s to `package object` and `companion object` to enable the Scala
compiler search them automatically without explicit importing.
    It should not break any API. I compiled the following codes with Spark 1.1.0:
    import org.apache.spark.{SparkContext, SparkConf}
    import org.apache.spark.SparkContext._
    object ImplicitBackforwardCompatibilityApp {
      def main(args: Array[String]): Unit = {
        val conf = new SparkConf().setAppName("ImplicitBackforwardCompatibilityApp")
        val sc = new SparkContext(conf)
        val rdd = sc.parallelize(1 to 100).map(i => (i, i))
        val rdd2 = rdd.groupByKey() // rddToPairRDDFunctions
        val rdd3 = rdd2.sortByKey() // rddToOrderedRDDFunctions
        val s1 = // numericRDDToDoubleRDDFunctions
        val s2 = // doubleRDDToDoubleRDDFunctions
        val f = rdd2.countAsync() // rddToAsyncRDDActions
        println(f.get()) { case (k, v) => (k, v.size) } saveAsSequenceFile("/tmp/test_path") //
        val a1 = sc.accumulator(123.4) // DoubleAccumulatorParam
        val a2 = sc.accumulator(123) // IntAccumulatorParam
        val a3 = sc.accumulator(123L) // LongAccumulatorParam
        val a4 = sc.accumulator(123F) // FloatAccumulatorParam
    And run it with this PR. It ran correctly.
    However, for `WritableConverter`, I cannot make it work without `import`. Thoughts?

You can merge this pull request into a Git repository by running:

    $ git pull SPARK-4397

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3262
commit 1eda9e4921617bc71acf2bb502cf3a22ee43c41f
Author: zsxwing <>
Date:   2014-11-14T07:35:02Z

    Reorganize 'implicit's to improve the API convenience


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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message