yaooqinn commented on a change in pull request #26775: [SPARK-30018][SQL] 
Support ALTER DATABASE SET OWNER syntax
URL: https://github.com/apache/spark/pull/26775#discussion_r355329283
 
 

 ##########
 File path: 
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsNamespaces.java
 ##########
 @@ -64,9 +65,37 @@
   String PROP_OWNER_TYPE = "ownerType";
 
   /**
-   * The list of reserved namespace properties.
+   * The list of namespace ownership properties, which can be used in `ALTER` 
syntax:
+   *
+   * {{
+   *   ALTER (DATABASE|SCHEMA|NAMESPACE) SET OWNER ...
+   * }}
+   */
+  List<String> OWNERSHIPS = Arrays.asList(PROP_OWNER_NAME, PROP_OWNER_TYPE);
+
+  /**
+   * The list of immutable namespace properties, which can not be removed or 
changed directly by
+   * the syntax:
+   * {{
+   *   ALTER (DATABASE|SCHEMA|NAMESPACE) SET DBPROPERTIES(...)
+   * }}
+   *
+   * They need specific syntax to modify
+   */
+  List<String> REVERSED_PROPERTIES =
+    Arrays.asList(PROP_COMMENT, PROP_LOCATION, PROP_OWNER_NAME, 
PROP_OWNER_TYPE);
+
+  /**
+   * Specify the default owner name for `CREATE` namespace.
+   *
+   */
+  default String defaultOwner() { return Utils.getCurrentUserName(); }
 
 Review comment:
   OK

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to