GitHub user sharkdtu opened a pull request:
https://github.com/apache/spark/pull/14088
Fix bugs for "Can not get user config when calling SparkHadoopUtil.get.conf
in other places"
## What changes were proposed in this pull request?
Fix bugs for "Can not get user config when calling SparkHadoopUtil.get.conf
in other places".
The `SparkHadoopUtil` singleton was instantiated before
`ApplicationMaster`, So the `sparkConf` and `conf` in the `SparkHadoopUtil`
singleton didn't include user's configuration. But other places, such as
`DataSourceStrategy`, use `hadoopConf` in `SparkHadoopUtil`:
```scala
...
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
val confBroadcast =
t.sqlContext.sparkContext.broadcast(new
SerializableConfiguration(sharedHadoopConf))
...
```
## How was this patch tested?
Use exist test cases
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sharkdtu/spark master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14088.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14088
----
commit 55e66b21cdcd68861db0f1045186048c54b13153
Author: sharkdtu <[email protected]>
Date: 2016-07-07T11:04:11Z
Fix bugs for "Can not get user config when calling SparkHadoopUtil.get.conf
in other places, such as DataSourceStrategy"
----
---
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]