Github user tgravescs commented on a diff in the pull request:
https://github.com/apache/spark/pull/4106#discussion_r23312771
--- 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 --
I don't think we want to do this here (we definitely don't on yarn), see
the comment on runAsSparkUser. Generally you want to do the runAsSparkUser once
as high up as possible
---
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]