Skip to content

[SPARK-27693][SQL] Add default catalog property #24594

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

Conversation

rdblue
Copy link
Contributor

@rdblue rdblue commented May 13, 2019

What changes were proposed in this pull request?

Add a SQL config property for the default v2 catalog.

How was this patch tested?

Existing tests for regressions.

@rdblue
Copy link
Contributor Author

rdblue commented May 13, 2019

@jzhuge, @mccheah, @cloud-fan, here is a PR that adds a config property to set the default v2 catalog.

@SparkQA
Copy link

SparkQA commented May 13, 2019

Test build #105366 has finished for PR 24594 at commit f4a0621.

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

Copy link
Member

@jzhuge jzhuge left a comment

Choose a reason for hiding this comment

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

LGTM

@rdblue
Copy link
Contributor Author

rdblue commented May 14, 2019

@cloud-fan, can you take a look at this? Future PRs depend on the default catalog to resolve v2 tables.

@SparkQA
Copy link

SparkQA commented May 14, 2019

Test build #105386 has finished for PR 24594 at commit d8e2849.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class ResourceInformation(

@rdblue rdblue force-pushed the SPARK-27693-add-default-catalog-config branch from d8e2849 to 03cf48b Compare May 15, 2019 16:18
@rdblue
Copy link
Contributor Author

rdblue commented May 15, 2019

I've rebased and updated this to enable the tests that were ignored in #24570.

@SparkQA
Copy link

SparkQA commented May 15, 2019

Test build #105421 has finished for PR 24594 at commit 03cf48b.

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

@rdblue
Copy link
Contributor Author

rdblue commented May 19, 2019

@cloud-fan, any more comments? It would be great to get this in so that we can start using it.

@@ -1767,6 +1767,11 @@ object SQLConf {
"with String")
.booleanConf
.createWithDefault(false)

val DEFAULT_V2_CATALOG = buildConf("spark.sql.default.catalog")
.doc("Name of the default v2 catalog, used when an catalog is not identified in queries")
Copy link
Member

Choose a reason for hiding this comment

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

nit. an catalog -> a catalog.

Copy link
Contributor

Choose a reason for hiding this comment

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

as we discussed in the DS v2 meeting, we should clearly point out which places this default catalog is used. View/Function resolution definitely doesn't use this default catalog for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, we need to make clear choices and document where this is used.

@dongjoon-hyun
Copy link
Member

Retest this please.

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. Thank you, @rdblue and @jzhuge .

I'll merge this to the master branch after fixing the typo.

cc @cloud-fan and @gatorsmile .

dongjoon-hyun pushed a commit that referenced this pull request May 20, 2019
Add a SQL config property for the default v2 catalog.

Existing tests for regressions.

Closes #24594 from rdblue/SPARK-27693-add-default-catalog-config.

Authored-by: Ryan Blue <blue@apache.org>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
@jzhuge
Copy link
Member

jzhuge commented May 20, 2019

Thanks @dongjoon-hyun !

@@ -1767,6 +1767,11 @@ object SQLConf {
"with String")
.booleanConf
.createWithDefault(false)

val DEFAULT_V2_CATALOG = buildConf("spark.sql.default.catalog")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: spark.sql.catalog.default is more consistent with other SQL config names: spark.sql.componentName.featureName.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason for this order is that spark.sql.catalog.(name) properties are used to register catalogs. So the property name you suggest creates a catalog named "default" using the existing convention. We could change the properties to use catalogs instead if you'd prefer. Then the catalog.default name would not conflict.

Copy link
Member

Choose a reason for hiding this comment

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

As @rdblue mentioned, spark.sql.catalog.default has meaning. Also, the spark.sql.default.catalog was the name already used in our code base before this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see the problem now.

Since we already have spark.sql.defaultSizeInBytes, shall we name it spark.sql.defaultCatalog?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That works for me. I'll open a PR to rename.

Copy link
Member

Choose a reason for hiding this comment

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

+1, too~

@SparkQA
Copy link

SparkQA commented May 20, 2019

Test build #105546 has finished for PR 24594 at commit 03cf48b.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

mccheah pushed a commit to palantir/spark that referenced this pull request Jun 6, 2019
Add a SQL config property for the default v2 catalog.

Existing tests for regressions.

Closes apache#24594 from rdblue/SPARK-27693-add-default-catalog-config.

Authored-by: Ryan Blue <blue@apache.org>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
cloud-fan added a commit that referenced this pull request Nov 13, 2019
### What changes were proposed in this pull request?

rename the config to address the comment: #24594 (comment)

improve the config description, provide a default value to simplify the code.

### Why are the changes needed?

make the config more understandable.

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

no

### How was this patch tested?

existing tests

Closes #26395 from cloud-fan/config.

Authored-by: Wenchen Fan <wenchen@databricks.com>
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.

5 participants