-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-30018][SQL] Support ALTER DATABASE SET OWNER syntax #26775
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 2 commits
3c96091
7188587
56ac955
25cf227
dd1d52b
c1680a4
824cb6a
406c5c2
10e1bc3
d4017b2
42ec005
e5d695e
162fbf0
ae1ebec
bb2f919
c76e5b5
2182992
514b78a
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 |
|---|---|---|
|
|
@@ -17,10 +17,13 @@ | |
|
|
||
| package org.apache.spark.sql.catalyst.analysis | ||
|
|
||
| import scala.collection.JavaConverters._ | ||
|
|
||
| import org.apache.spark.sql.AnalysisException | ||
| import org.apache.spark.sql.catalyst.plans.logical._ | ||
| import org.apache.spark.sql.catalyst.rules.Rule | ||
| import org.apache.spark.sql.connector.catalog.{CatalogManager, CatalogPlugin, LookupCatalog, SupportsNamespaces, TableCatalog, TableChange} | ||
| import org.apache.spark.sql.connector.catalog.{CatalogManager, CatalogPlugin, LookupCatalog, TableCatalog, TableChange} | ||
| import org.apache.spark.sql.connector.catalog.SupportsNamespaces._ | ||
|
|
||
| /** | ||
| * Resolves catalogs from the multi-part identifiers in SQL statements, and convert the statements | ||
|
|
@@ -94,11 +97,18 @@ class ResolveCatalogs(val catalogManager: CatalogManager) | |
| s"because view support in catalog has not been implemented yet") | ||
|
|
||
| case AlterNamespaceSetPropertiesStatement(NonSessionCatalog(catalog, nameParts), properties) => | ||
| AlterNamespaceSetProperties(catalog.asNamespaceCatalog, nameParts, properties) | ||
| val availableProps = properties -- RESERVED_PROPERTIES.asScala | ||
|
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. I think it's better to fail if reserved properties are being set/altered.
Member
Author
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. ok, I will go this way.
Member
Author
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. I notice that the
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. can Hive alter table location via ALTER TABLE SET TBLPROPERTIES? Seems like Hive can only do it for table comment: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AlterTableComment
Member
Author
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. Hive will not change Database field members via properties, if we set dbproperites('location'='xxx'), the
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. OK so we can't follow Hive here. It seems wrong to me to change location and owner with SET TBLPROPERTIES or SET DBPROPERTIES, but comment should be fine. |
||
| AlterNamespaceSetProperties(catalog.asNamespaceCatalog, nameParts, availableProps) | ||
|
|
||
| case AlterNamespaceSetLocationStatement(NonSessionCatalog(catalog, nameParts), location) => | ||
| AlterNamespaceSetProperties(catalog.asNamespaceCatalog, nameParts, | ||
| Map(SupportsNamespaces.PROP_LOCATION -> location)) | ||
| Map(PROP_LOCATION -> location)) | ||
|
|
||
| case AlterNamespaceSetOwnerStatement(NonSessionCatalog(catalog, nameParts), name, typ) => | ||
| AlterNamespaceSetProperties( | ||
| catalog.asNamespaceCatalog, | ||
| nameParts, | ||
| Map(PROP_OWNER_NAME -> name, PROP_OWNER_TYPE -> typ)) | ||
|
|
||
| case RenameTableStatement(NonSessionCatalog(catalog, oldName), newNameParts, isView) => | ||
| if (isView) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.