miland-db commented on code in PR #53508:
URL: https://github.com/apache/spark/pull/53508#discussion_r2634968416


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala:
##########
@@ -695,19 +695,43 @@ object ViewSyncSchemaToMetaStore extends (LogicalPlan => 
Unit) {
           (field.dataType != planField.dataType ||
             field.nullable != planField.nullable ||
             (viewSchemaMode == SchemaEvolution && (
-              field.getComment() != planField.getComment() ||
-              field.name != planField.name)))
+              field.name != planField.name ||
+                // Only trigger redo on comment changes if preserve flag is 
disabled.
+                
(!session.sessionState.conf.viewSchemaEvolutionPreserveUserComments &&
+                  field.getComment() != planField.getComment()))))
         }
 
+        lazy val viewFieldsByName = viewFields.map(f => f.name -> f).toMap

Review Comment:
   Well, in case nothing changed we don't compute it, and I would say that is 
every `SELECT` query.



-- 
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]

Reply via email to