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

    https://github.com/apache/spark/pull/4106#discussion_r24860380
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala ---
    @@ -193,17 +193,21 @@ class HadoopRDD[K, V](
       override def getPartitions: Array[Partition] = {
         val jobConf = getJobConf()
         // add the credentials here as this can be called before SparkContext 
initialized
    +    // Also need to explicitly run this as the Spark user to pick up 
permissions -
    +    // the driver does not invoke runAsSparkUser elsewhere, unlike the 
executors
         SparkHadoopUtil.get.addCredentials(jobConf)
    -    val inputFormat = getInputFormat(jobConf)
    -    if (inputFormat.isInstanceOf[Configurable]) {
    -      inputFormat.asInstanceOf[Configurable].setConf(jobConf)
    -    }
    -    val inputSplits = inputFormat.getSplits(jobConf, minPartitions)
    -    val array = new Array[Partition](inputSplits.size)
    -    for (i <- 0 until inputSplits.size) {
    -      array(i) = new HadoopPartition(id, i, inputSplits(i))
    -    }
    -    array
    +    SparkHadoopUtil.get.runAsSparkUser(() => {
    --- End diff --
    
    Am I supposed to do this when the driver starts then? Because the driver 
needs it in this case. I don't know how YARN gets around this.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to