gengliangwang commented on code in PR #46267:
URL: https://github.com/apache/spark/pull/46267#discussion_r1591545095


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala:
##########
@@ -401,6 +401,25 @@ case class CatalogTable(
     )
   }
 
+  /**
+   * Return the schema binding mode. Defaults to SchemaCompensation if not a 
view or an older
+   * version, unless the viewSchemaBinding config is set to UNSUPPORTED
+   */
+  def viewSchemaMode: ViewSchemaMode = {
+    if (SQLConf.get.viewSchemaBinding == "UNSUPPORTED") {
+      SchemaUnsupported
+    } else {
+      val schemaMode = properties.getOrElse(VIEW_SCHEMA_MODE, 
SchemaCompensation.toString)
+        .stripSuffix("\"").stripPrefix("\"")
+      schemaMode match {
+        case SchemaBinding.toString => SchemaBinding
+        case SchemaEvolution.toString => SchemaEvolution
+        case SchemaTypeEvolution.toString => SchemaTypeEvolution
+        case SchemaCompensation.toString => SchemaCompensation

Review Comment:
   nit: let's handle the default case in the match here.



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