nastra commented on code in PR #9513:
URL: https://github.com/apache/iceberg/pull/9513#discussion_r1469477447
##########
spark/v3.5/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/RewriteViewCommands.scala:
##########
@@ -60,17 +65,27 @@ case class RewriteViewCommands(spark: SparkSession) extends
Rule[LogicalPlan] wi
properties = properties,
allowExisting = allowExisting,
replace = replace)
+
+ case a@AlterViewAs(ResolvedV2View(_, ident, _), _, query) =>
+ val q = CTESubstitution.apply(query)
+ verifyTemporaryObjectsDontExist(ident, q)
+ a.copy(query = q)
+
+ case u@UnresolvedView(IsIcebergView(resolved), _, _, _) =>
+ loadView(resolved.catalog, resolved.identifier)
+ .map(v => ResolvedV2View(resolved.catalog.asViewCatalog,
resolved.identifier, v))
+ .getOrElse(u)
+
+ case ShowViews(UnresolvedNamespace(ns), pattern, output)
+ if isViewCatalog(spark.sessionState.catalogManager.currentCatalog) =>
+ ShowIcebergViews(UnresolvedNamespace(ns), pattern, output)
Review Comment:
I've updated this to use `CatalogAndNamespace` for this particular case. For
the case where no namespace is given, we need to match
`ShowViews(UnresolvedNamespace(Seq()), pattern, output)`
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]