mccheah commented on issue #25206: [SPARK-28265][SQL] Add renameTable to TableCatalog API URL: https://github.com/apache/spark/pull/25206#issuecomment-516929201 I think we have to be more flexible here because of how loose the definition of a namespace is. Sure, many traditional database systems don't inherently support moving tables from one database to another - but the definition of a namespace in the context of DSv2 is more broad than a database. A namespace could map to a user, for example, in which case moving a table from one namespace to another is effectively transferring ownership of the table; then the underlying catalog could, for example, check ACLs as part of validation and potentially throw an authorization error instead of an analysis one. It depends on the goal at the end of the day - is the goal that the same SQL statements produce exactly the same behavior across all catalogs, or is the goal that the catalog implementation is given maximum optionality and flexibility? If we want SQL to behave exactly the same across all catalogs, then yes we would throw the analysis exception, but then catalog implementations would never be given the opportunity to move tables from one namespace to another, effectively forcing the user to find a workaround. (We could add a flag to `ALTER TABLE... RENAME`, but if a given database doesn't support moving across namespaces anyways, then this SQL statement would suddenly have different behavior across catalogs anyways, negating the original goal.) But I will note that we've been aiming for consistency in other parts of the DSv2 project. I think it's a fine balance and something we have to call on a case by case basis.
---------------------------------------------------------------- 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]
