spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tgravescs <...@git.apache.org>
Subject [GitHub] spark pull request: SPARK-1195: set map_input_file environment var...
Date Fri, 07 Mar 2014 00:18:31 GMT
Github user tgravescs commented on a diff in the pull request:

    https://github.com/apache/spark/pull/94#discussion_r10368475
  
    --- Diff: core/src/test/scala/org/apache/spark/PipedRDDSuite.scala ---
    @@ -89,4 +97,37 @@ class PipedRDDSuite extends FunSuite with SharedSparkContext {
         }
       }
     
    +  test("test pipe exports map_input_file") {
    +    testExportInputFile("map_input_file")
    +  }
    +
    +  test("test pipe exports mapreduce_map_input_file") {
    +    testExportInputFile("mapreduce_map_input_file")
    +  }
    +
    +  def testExportInputFile(varName:String) {
    +    val nums = new HadoopRDD(sc, new JobConf(), classOf[TextInputFormat], classOf[LongWritable],
    +        classOf[Text], 2) {
    +      override def getPartitions: Array[Partition] = Array(generateFakeHadoopPartition())
    +      override val getDependencies = List[Dependency[_]]()
    +      override def compute(theSplit: Partition, context: TaskContext) = {
    +        new InterruptibleIterator[(LongWritable, Text)](context, Iterator((new LongWritable(1),
    +          new Text("b"))))
    +      }
    +    }
    +    val hadoopPart1 = generateFakeHadoopPartition()
    +    val pipedRdd = new PipedRDD(nums, "printenv " + varName)
    --- End diff --
    
    Is there a convention or perhaps utilities for doing this already?  I didn't see one doing
quick look but I might have missed it.  
    
    Note I copied the printenv command from a test above so I'll change both. 


---
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