Skip to content

[SPARK-17245] [SQL] [BRANCH-1.6] Do not rely on Hive's session state to retrieve HiveConf #14816

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

Closed
wants to merge 1 commit into from

Conversation

yhuai
Copy link
Contributor

@yhuai yhuai commented Aug 25, 2016

What changes were proposed in this pull request?

Right now, we rely on Hive's SessionState.get() to retrieve the HiveConf used by ClientWrapper. However, this conf is actually the HiveConf set with the state. There is a small chance that we are trying to use the Hive client in a new thread while the global client has not been created yet. In this case, SessionState.get() will return a null, which causes a NPE when we call SessionState.get(). getConf. Since the conf that we want is actually the conf we set to state. I am changing the code to just call state.getConf (this is also what Spark 2.0 does).

How was this patch tested?

I have not figured out a good way to reproduce this.

@SparkQA
Copy link

SparkQA commented Aug 25, 2016

Test build #64439 has finished for PR 14816 at commit 8b57886.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yhuai
Copy link
Contributor Author

yhuai commented Aug 25, 2016

test this please

1 similar comment
@yhuai
Copy link
Contributor Author

yhuai commented Aug 25, 2016

test this please

@SparkQA
Copy link

SparkQA commented Aug 26, 2016

Test build #64443 has finished for PR 14816 at commit 8b57886.

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

@yhuai
Copy link
Contributor Author

yhuai commented Sep 6, 2016

test this please

@SparkQA
Copy link

SparkQA commented Sep 7, 2016

Test build #65014 has finished for PR 14816 at commit 8b57886.

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

@cloud-fan
Copy link
Contributor

LGTM, merging to 1.6

asfgit pushed a commit that referenced this pull request Sep 7, 2016
… retrieve HiveConf

## What changes were proposed in this pull request?
Right now, we rely on Hive's `SessionState.get()` to retrieve the HiveConf used by ClientWrapper. However, this conf is actually the HiveConf set with the `state`. There is a small chance that we are trying to use the Hive client in a new thread while the global client has not been created yet. In this case, `SessionState.get()` will return a `null`, which causes a NPE when we call `SessionState.get(). getConf `. Since the conf that we want is actually the conf we set to `state`. I am changing the code to just call `state.getConf` (this is also what Spark 2.0 does).

## How was this patch tested?
I have not figured out a good way to reproduce this.

Author: Yin Huai <yhuai@databricks.com>

Closes #14816 from yhuai/SPARK-17245.
@JoshRosen
Copy link
Contributor

@yhuai, could you close this PR now that it's been merged?

zzcclp pushed a commit to zzcclp/spark that referenced this pull request Sep 8, 2016
… retrieve HiveConf

## What changes were proposed in this pull request?
Right now, we rely on Hive's `SessionState.get()` to retrieve the HiveConf used by ClientWrapper. However, this conf is actually the HiveConf set with the `state`. There is a small chance that we are trying to use the Hive client in a new thread while the global client has not been created yet. In this case, `SessionState.get()` will return a `null`, which causes a NPE when we call `SessionState.get(). getConf `. Since the conf that we want is actually the conf we set to `state`. I am changing the code to just call `state.getConf` (this is also what Spark 2.0 does).

## How was this patch tested?
I have not figured out a good way to reproduce this.

Author: Yin Huai <yhuai@databricks.com>

Closes apache#14816 from yhuai/SPARK-17245.

(cherry picked from commit 047bc3f)
@yhuai yhuai closed this Sep 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants