Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,16 @@ class SparkHadoopUtil extends Logging {
hadoopConf.set("fs.s3n.awsSecretAccessKey", accessKey)
hadoopConf.set("fs.s3a.secret.key", accessKey)
}
// Copy any "spark.hadoop.foo=bar" system properties into conf as "foo=bar"
conf.getAll.foreach { case (key, value) =>
// Copy any "spark.hadoop.foo=bar" system properties into conf as "foo=bar"
if (key.startsWith("spark.hadoop.")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment above does not apply for the whole loop anymore and should be moved to this if statement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

hadoopConf.set(key.substring("spark.hadoop.".length), value)
}
// fix added for SPARK-13979
// Copy any "fs.*=bar" properties into conf it will cover almost all filesystem
else if (key.startsWith("fs.")){
hadoopConf.set(key, value)
}
}
val bufferSize = conf.get("spark.buffer.size", "65536")
hadoopConf.set("io.file.buffer.size", bufferSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ private[sql] object DataSourceStrategy extends Strategy with Logging {
case PhysicalOperation(projects, filters, l @ LogicalRelation(t: HadoopFsRelation, _)) =>
// See buildPartitionedTableScan for the reason that we need to create a shard
// broadcast HadoopConf.
val sharedHadoopConf = SparkHadoopUtil.get.conf
// fix added for SPARK-13979
// val sharedHadoopConf = SparkHadoopUtil.get.conf
val sharedHadoopConf = t.sqlContext.sparkContext.hadoopConfiguration
val confBroadcast =
t.sqlContext.sparkContext.broadcast(new SerializableConfiguration(sharedHadoopConf))
pruneFilterProject(
Expand Down Expand Up @@ -156,7 +158,9 @@ private[sql] object DataSourceStrategy extends Strategy with Logging {

// Because we are creating one RDD per partition, we need to have a shared HadoopConf.
// Otherwise, the cost of broadcasting HadoopConf in every RDD will be high.
val sharedHadoopConf = SparkHadoopUtil.get.conf
// fix added for SPARK-13979
// val sharedHadoopConf = SparkHadoopUtil.get.conf
val sharedHadoopConf = relation.sqlContext.sparkContext.hadoopConfiguration
val confBroadcast =
relation.sqlContext.sparkContext.broadcast(new SerializableConfiguration(sharedHadoopConf))
val partitionColumnNames = partitionColumns.fieldNames.toSet
Expand Down