cloud-fan commented on a change in pull request #26847: [SPARK-30214][SQL] A
new framework to resolve v2 commands
URL: https://github.com/apache/spark/pull/26847#discussion_r361654551
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala
##########
@@ -210,6 +212,19 @@ object DataSourceV2Strategy extends Strategy with
PredicateHelper {
case AlterNamespaceSetProperties(catalog, namespace, properties) =>
AlterNamespaceSetPropertiesExec(catalog, namespace, properties) :: Nil
+ case CommentOnNamespace(ResolvedNamespace(catalog, namespace), comment) =>
+ AlterNamespaceSetPropertiesExec(
+ catalog,
+ namespace,
+ Map(SupportsNamespaces.PROP_COMMENT -> comment)) :: Nil
+
+ case CommentOnTable(plan, comment) => plan match {
+ case ResolvedTable(catalog, identifier, _) =>
+ val changes = TableChange.setProperty(TableCatalog.PROP_COMMENT,
comment)
+ AlterTableExec(catalog, identifier, Seq(changes)) :: Nil
+ case _ => throw new AnalysisException("COMMENT ON TABLE does not support
views.")
Review comment:
We shouldn't let planner to do this check for each command, how about we do
the check as https://github.com/apache/spark/pull/26847/files#r361632741 ?
----------------------------------------------------------------
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]