cloud-fan commented on code in PR #46267:
URL: https://github.com/apache/spark/pull/46267#discussion_r1595519795
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala:
##########
@@ -620,3 +621,66 @@ object CollationCheck extends (LogicalPlan => Unit) {
private def isCollationExpression(expression: Expression): Boolean =
expression.isInstanceOf[Collation] || expression.isInstanceOf[Collate]
}
+
+
+/**
+ * This rule checks for references to views WITH SCHEMA [TYPE] EVOLUTION and
synchronizes the
+ * catalog if evolution was detected.
+ * It does so by walking the resolved plan looking for View operators for
persisted views.
+ */
+object SyncViewsCheck extends (LogicalPlan => Unit) {
+ def apply(plan: LogicalPlan): Unit = {
+ plan.foreach {
+ case View(metaData, isTempView, viewQuery)
+ if (metaData.viewSchemaMode != SchemaUnsupported && !isTempView) =>
Review Comment:
```suggestion
case View(metaData, isTempView, viewQuery)
if (metaData.viewSchemaMode != SchemaUnsupported && !isTempView) =>
```
```suggestion
case View(metaData, false, viewQuery)
if metaData.viewSchemaMode == SchemaTypeEvolution ||
metaData.viewSchemaMode == SchemaEvolution =>
```
--
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]