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-20967][SQL] SharedState.externalCatalog is not really lazy #18187

Closed
wants to merge 1 commit into from

Conversation

cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

SharedState.externalCatalog is marked as a lazy val but actually it's not lazy. We access externalCatalog while initializing SharedState and thus eliminate the effort of lazy val. When creating ExternalCatalog we will try to connect to the metastore and may throw an error, so it makes sense to make it a lazy val in SharedState.

How was this patch tested?

existing tests.

@cloud-fan
Copy link
Contributor Author

cc @gatorsmile

@SparkQA
Copy link

SparkQA commented Jun 2, 2017

Test build #77676 has finished for PR 18187 at commit 7d7331c.

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

@dongjoon-hyun
Copy link
Member

+1, LGTM.

@cloud-fan
Copy link
Contributor Author

thanks for the review, merging to master/2.2!

@asfgit asfgit closed this in d1b80ab Jun 2, 2017
asfgit pushed a commit that referenced this pull request Jun 2, 2017
## What changes were proposed in this pull request?

`SharedState.externalCatalog` is marked as a `lazy val` but actually it's not lazy. We access `externalCatalog` while initializing `SharedState` and thus eliminate the effort of `lazy val`. When creating `ExternalCatalog` we will try to connect to the metastore and may throw an error, so it makes sense to make it a `lazy val` in `SharedState`.

## How was this patch tested?

existing tests.

Author: Wenchen Fan <wenchen@databricks.com>

Closes #18187 from cloud-fan/minor.

(cherry picked from commit d1b80ab)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
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.

3 participants