-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[SPARK-31100][SQL] Check namespace existens when setting namespace #27900
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
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1394,6 +1394,7 @@ class DataSourceV2SQLSuite | |
|
|
||
| test("Use: v2 catalog is used and namespace does not exist") { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should update this test with catalogs that don't implement |
||
| // Namespaces are not required to exist for v2 catalogs. | ||
| sql("create namespace testcat.ns1.ns2") | ||
| sql("USE testcat.ns1.ns2") | ||
| val catalogManager = spark.sessionState.catalogManager | ||
| assert(catalogManager.currentNamespace === Array("ns1", "ns2")) | ||
|
|
@@ -1418,6 +1419,7 @@ class DataSourceV2SQLSuite | |
|
|
||
| sql("USE testcat") | ||
| testShowCurrentNamespace("testcat", "") | ||
| sql("create namespace testcat.ns1.ns2") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please upper case the SQL keywords |
||
| sql("USE testcat.ns1.ns2") | ||
| testShowCurrentNamespace("testcat", "ns1.ns2") | ||
| } | ||
|
|
@@ -2257,6 +2259,7 @@ class DataSourceV2SQLSuite | |
| spark.conf.unset(V2_SESSION_CATALOG_IMPLEMENTATION.key) | ||
| val sessionCatalogName = CatalogManager.SESSION_CATALOG_NAME | ||
|
|
||
| sql("create namespace testcat.ns1.ns2") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
| sql("USE testcat.ns1.ns2") | ||
| sql("CREATE TABLE t USING foo AS SELECT 1 col") | ||
| checkAnswer(spark.table("t"), Row(1)) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.