Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-33740][SQL] hadoop configs in hive-site.xml can overrides pre-existing hadoop ones #30709

Closed
wants to merge 2 commits into from

Conversation

yaooqinn
Copy link
Member

What changes were proposed in this pull request?

org.apache.hadoop.conf.Configuration#setIfUnset will ignore those with defaults too

Why are the changes needed?

fix a regression

Does this PR introduce any user-facing change?

no

How was this patch tested?

new tests

@yaooqinn
Copy link
Member Author

cc @cloud-fan @maropu thanks

@github-actions github-actions bot added the SQL label Dec 10, 2020
@SparkQA
Copy link

SparkQA commented Dec 10, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37183/

@SparkQA
Copy link

SparkQA commented Dec 10, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37183/

@SparkQA
Copy link

SparkQA commented Dec 10, 2020

Test build #132578 has finished for PR 30709 at commit c333672.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. I checked that the code is added by SPARK-31170 at 3.0.0, too.
Merged to master/3.1.

dongjoon-hyun pushed a commit that referenced this pull request Dec 11, 2020
…existing hadoop ones

### What changes were proposed in this pull request?
org.apache.hadoop.conf.Configuration#setIfUnset will ignore those with defaults too

### Why are the changes needed?

fix a regression

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

new tests

Closes #30709 from yaooqinn/SPARK-33740.

Authored-by: Kent Yao <yaooqinn@hotmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 31e0bac)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@dongjoon-hyun
Copy link
Member

Could you make a backport to branch-3.0 branch, @yaooqinn ?


def containsInSparkConf(key: String): Boolean = {
sparkConf.contains(key) || sparkConf.contains("spark.hadoop." + key) ||
(key.startsWith("hive") && sparkConf.contains("spark." + key))
Copy link
Member

Choose a reason for hiding this comment

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

nit: It seems there is no test for the condition (key.startsWith("hive") && sparkConf.contains("spark." + key))?

@@ -228,14 +228,21 @@ object SharedState extends Logging {
sparkConf: SparkConf,
hadoopConf: Configuration,
initialConfigs: scala.collection.Map[String, String] = Map.empty): Unit = {

def containsInSparkConf(key: String): Boolean = {
sparkConf.contains(key) || sparkConf.contains("spark.hadoop." + key) ||
Copy link
Member

Choose a reason for hiding this comment

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

(This is not related to this PR though) The string prefix "spark.hadoop." seems to be used in many places, so how about defining a global value for it somewhere? I think that the refactoring could make it easy to track the positions where the prefix is used.

@maropu
Copy link
Member

maropu commented Dec 11, 2020

lgtm

dongjoon-hyun pushed a commit that referenced this pull request Dec 11, 2020
… pre-existing hadoop ones

Backport  #30709 to 3.0

### What changes were proposed in this pull request?

 org.apache.hadoop.conf.Configuration#setIfUnset will ignore those with defaults too

### Why are the changes needed?

    fix a regression

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

new tests

Closes #30720 from yaooqinn/SPARK-33740-30.

Authored-by: Kent Yao <yaooqinn@hotmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants